vexflow 5.0.0-alpha.3 → 5.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +2066 -1877
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +1052 -993
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/src/accidental.js +22 -28
- package/build/esm/src/annotation.js +0 -2
- package/build/esm/src/barnote.js +3 -3
- package/build/esm/src/beam.js +26 -46
- package/build/esm/src/bend.js +11 -3
- package/build/esm/src/chordsymbol.js +0 -4
- package/build/esm/src/clef.js +0 -2
- package/build/esm/src/clefnote.js +6 -1
- package/build/esm/src/curve.js +8 -5
- package/build/esm/src/element.js +94 -118
- package/build/esm/src/factory.js +4 -4
- package/build/esm/src/flag.js +20 -0
- package/build/esm/src/fonts/gonville.js +1 -1
- package/build/esm/src/formatter.js +13 -21
- package/build/esm/src/fraction.js +15 -22
- package/build/esm/src/glyphnote.js +3 -4
- package/build/esm/src/gracenote.js +0 -2
- package/build/esm/src/gracenotegroup.js +17 -8
- package/build/esm/src/index.js +1 -0
- package/build/esm/src/keysignature.js +38 -31
- package/build/esm/src/keysignote.js +1 -1
- package/build/esm/src/metrics.js +58 -7
- package/build/esm/src/modifier.js +10 -23
- package/build/esm/src/multimeasurerest.js +16 -25
- package/build/esm/src/note.js +7 -0
- package/build/esm/src/notehead.js +6 -1
- package/build/esm/src/ornament.js +0 -2
- package/build/esm/src/pedalmarking.js +33 -41
- package/build/esm/src/registry.js +5 -19
- package/build/esm/src/stave.js +11 -19
- package/build/esm/src/stavebarline.js +2 -3
- package/build/esm/src/stavehairpin.js +1 -1
- package/build/esm/src/staveline.js +0 -4
- package/build/esm/src/stavemodifier.js +0 -2
- package/build/esm/src/stavenote.js +42 -68
- package/build/esm/src/staverepetition.js +3 -2
- package/build/esm/src/stavesection.js +13 -15
- package/build/esm/src/stavetempo.js +7 -13
- package/build/esm/src/stavetext.js +2 -2
- package/build/esm/src/stavetie.js +82 -40
- package/build/esm/src/stavevolta.js +3 -2
- package/build/esm/src/stem.js +0 -4
- package/build/esm/src/stemmablenote.js +5 -6
- package/build/esm/src/stringnumber.js +0 -2
- package/build/esm/src/svgcontext.js +5 -13
- package/build/esm/src/tabnote.js +2 -8
- package/build/esm/src/textbracket.js +0 -3
- package/build/esm/src/textnote.js +0 -2
- package/build/esm/src/tickable.js +13 -26
- package/build/esm/src/tickcontext.js +20 -2
- package/build/esm/src/timesignature.js +2 -4
- package/build/esm/src/timesignote.js +2 -0
- package/build/esm/src/tuplet.js +37 -30
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vexflow.js +6 -2
- package/build/esm/src/vibrato.js +6 -1
- package/build/esm/tests/accidental_tests.js +30 -17
- package/build/esm/tests/annotation_tests.js +12 -12
- package/build/esm/tests/articulation_tests.js +13 -13
- package/build/esm/tests/auto_beam_formatting_tests.js +33 -33
- package/build/esm/tests/beam_tests.js +1 -1
- package/build/esm/tests/bend_tests.js +7 -7
- package/build/esm/tests/chordsymbol_tests.js +8 -8
- package/build/esm/tests/clef_tests.js +5 -1
- package/build/esm/tests/curve_tests.js +34 -0
- package/build/esm/tests/{bach_tests.js → demo_petzold_tests.js} +7 -7
- package/build/esm/tests/dot_tests.js +4 -4
- package/build/esm/tests/formatter_tests.js +25 -25
- package/build/esm/tests/glyphnote_tests.js +6 -0
- package/build/esm/tests/gracenote_tests.js +2 -1
- package/build/esm/tests/gracetabnote_tests.js +1 -1
- package/build/esm/tests/index.js +1 -1
- package/build/esm/tests/key_clef_tests.js +6 -6
- package/build/esm/tests/keysignature_tests.js +20 -17
- package/build/esm/tests/notehead_tests.js +10 -7
- package/build/esm/tests/offscreencanvas_tests.js +1 -1
- package/build/esm/tests/ornament_tests.js +8 -8
- package/build/esm/tests/pedalmarking_tests.js +27 -0
- package/build/esm/tests/percussion_tests.js +6 -3
- package/build/esm/tests/renderer_tests.js +1 -1
- package/build/esm/tests/rests_tests.js +26 -26
- package/build/esm/tests/rhythm_tests.js +15 -15
- package/build/esm/tests/stave_tests.js +44 -43
- package/build/esm/tests/staveconnector_tests.js +73 -73
- package/build/esm/tests/stavehairpin_tests.js +1 -1
- package/build/esm/tests/stavemodifier_tests.js +3 -3
- package/build/esm/tests/stavenote_tests.js +29 -29
- package/build/esm/tests/stavetie_tests.js +29 -0
- package/build/esm/tests/stringnumber_tests.js +1 -1
- package/build/esm/tests/strokes_tests.js +1 -1
- package/build/esm/tests/style_tests.js +1 -1
- package/build/esm/tests/tabnote_tests.js +7 -7
- package/build/esm/tests/tabslide_tests.js +6 -6
- package/build/esm/tests/tabstave_tests.js +2 -1
- package/build/esm/tests/tabtie_tests.js +8 -8
- package/build/esm/tests/textnote_tests.js +1 -1
- package/build/esm/tests/threevoice_tests.js +2 -2
- package/build/esm/tests/timesignature_tests.js +23 -13
- package/build/esm/tests/vexflow_test_helpers.js +25 -39
- package/build/esm/tests/vibrato_tests.js +3 -3
- package/build/esm/tests/voice_tests.js +1 -1
- package/build/types/src/accidental.d.ts +19 -1
- package/build/types/src/annotation.d.ts +1 -1
- package/build/types/src/beam.d.ts +12 -1
- package/build/types/src/bend.d.ts +6 -0
- package/build/types/src/clefnote.d.ts +2 -0
- package/build/types/src/curve.d.ts +5 -4
- package/build/types/src/element.d.ts +23 -14
- package/build/types/src/factory.d.ts +2 -2
- package/build/types/src/flag.d.ts +12 -0
- package/build/types/src/fonts/gonville.d.ts +1 -1
- package/build/types/src/formatter.d.ts +5 -3
- package/build/types/src/fraction.d.ts +12 -7
- package/build/types/src/frethandfinger.d.ts +1 -1
- package/build/types/src/index.d.ts +1 -0
- package/build/types/src/keysignature.d.ts +7 -7
- package/build/types/src/metrics.d.ts +5 -0
- package/build/types/src/modifier.d.ts +3 -2
- package/build/types/src/multimeasurerest.d.ts +4 -1
- package/build/types/src/note.d.ts +2 -0
- package/build/types/src/pedalmarking.d.ts +2 -2
- package/build/types/src/registry.d.ts +1 -1
- package/build/types/src/stave.d.ts +1 -3
- package/build/types/src/stavebarline.d.ts +1 -1
- package/build/types/src/staveline.d.ts +1 -1
- package/build/types/src/stavemodifier.d.ts +0 -1
- package/build/types/src/stavenote.d.ts +2 -1
- package/build/types/src/staverepetition.d.ts +1 -1
- package/build/types/src/stavesection.d.ts +3 -4
- package/build/types/src/stavetempo.d.ts +4 -5
- package/build/types/src/stavetext.d.ts +1 -2
- package/build/types/src/stavetie.d.ts +39 -2
- package/build/types/src/stavevolta.d.ts +1 -2
- package/build/types/src/stemmablenote.d.ts +2 -3
- package/build/types/src/svgcontext.d.ts +1 -1
- package/build/types/src/tickable.d.ts +2 -1
- package/build/types/src/tickcontext.d.ts +30 -0
- package/build/types/src/tuplet.d.ts +2 -12
- package/build/types/src/typeguard.d.ts +1 -0
- package/package.json +33 -29
- package/tests/flow.html +2 -2
|
@@ -48,7 +48,7 @@ function withModifiers(options) {
|
|
|
48
48
|
const voiceW = formatter.preCalculateMinTotalWidth([voice]);
|
|
49
49
|
const staffW = voiceW + Stave.defaultPadding + getGlyphWidth(0xe050);
|
|
50
50
|
formatter.format([voice], voiceW);
|
|
51
|
-
const staff = f.Stave({ x: 10, y, width: staffW }).addClef('treble').
|
|
51
|
+
const staff = f.Stave({ x: 10, y, width: staffW }).addClef('treble').drawWithStyle();
|
|
52
52
|
voice.draw(ctx, staff);
|
|
53
53
|
}
|
|
54
54
|
let chords = [];
|
|
@@ -180,7 +180,7 @@ function kern(options) {
|
|
|
180
180
|
const ctx = f.getContext();
|
|
181
181
|
ctx.scale(1.5, 1.5);
|
|
182
182
|
function draw(chords, y) {
|
|
183
|
-
const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).
|
|
183
|
+
const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).drawWithStyle();
|
|
184
184
|
const notes = [
|
|
185
185
|
note(f, ['C/4'], 'q', chords[0]),
|
|
186
186
|
note(f, ['C/4'], 'q', chords[1]),
|
|
@@ -228,7 +228,7 @@ function top(options) {
|
|
|
228
228
|
ctx.scale(1.5, 1.5);
|
|
229
229
|
const note = (factory, keys, duration, chordSymbol, direction) => factory.StaveNote({ keys, duration, stemDirection: direction }).addModifier(chordSymbol, 0);
|
|
230
230
|
function draw(c1, c2, y) {
|
|
231
|
-
const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).
|
|
231
|
+
const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).drawWithStyle();
|
|
232
232
|
const notes = [
|
|
233
233
|
note(f, ['e/4', 'a/4', 'd/5'], 'h', c1, 1).addModifier(new Accidental('b'), 0),
|
|
234
234
|
note(f, ['c/5', 'e/5', 'c/6'], 'h', c2, -1),
|
|
@@ -264,7 +264,7 @@ function topJustify(options) {
|
|
|
264
264
|
const ctx = f.getContext();
|
|
265
265
|
ctx.scale(1.5, 1.5);
|
|
266
266
|
function draw(chord1, chord2, y) {
|
|
267
|
-
const stave = new Stave(10, y, 450).addClef('treble').setContext(ctx).
|
|
267
|
+
const stave = new Stave(10, y, 450).addClef('treble').setContext(ctx).drawWithStyle();
|
|
268
268
|
const notes = [
|
|
269
269
|
note(f, ['e/4', 'a/4', 'd/5'], 'h', chord1).addModifier(new Accidental('b'), 0),
|
|
270
270
|
note(f, ['c/4', 'e/4', 'B/4'], 'h', chord2),
|
|
@@ -304,7 +304,7 @@ function bottom(options) {
|
|
|
304
304
|
const ctx = f.getContext();
|
|
305
305
|
ctx.scale(1.5, 1.5);
|
|
306
306
|
function draw(chords, y) {
|
|
307
|
-
const stave = new Stave(10, y, 400).addClef('treble').setContext(ctx).
|
|
307
|
+
const stave = new Stave(10, y, 400).addClef('treble').setContext(ctx).drawWithStyle();
|
|
308
308
|
const notes = [
|
|
309
309
|
note(f, ['c/4', 'f/4', 'a/4'], 'q', chords[0]),
|
|
310
310
|
note(f, ['c/4', 'e/4', 'b/4'], 'q', chords[1]).addModifier(new Accidental('b'), 2),
|
|
@@ -328,7 +328,7 @@ function bottomStemDown(options) {
|
|
|
328
328
|
ctx.scale(1.5, 1.5);
|
|
329
329
|
function draw(chords, y) {
|
|
330
330
|
const note = (keys, duration, chordSymbol) => new StaveNote({ keys, duration, stemDirection: -1 }).addModifier(chordSymbol, 0);
|
|
331
|
-
const stave = new Stave(10, y, 400).addClef('treble').setContext(ctx).
|
|
331
|
+
const stave = new Stave(10, y, 400).addClef('treble').setContext(ctx).drawWithStyle();
|
|
332
332
|
const notes = [
|
|
333
333
|
note(['c/4', 'f/4', 'a/4'], 'q', chords[0]),
|
|
334
334
|
note(['c/4', 'e/4', 'b/4'], 'q', chords[1]).addModifier(new Accidental('b'), 2),
|
|
@@ -352,7 +352,7 @@ function doubleBottom(options) {
|
|
|
352
352
|
ctx.scale(1.5, 1.5);
|
|
353
353
|
function draw(chords, chords2, y) {
|
|
354
354
|
const note = (keys, duration, chordSymbol1, chordSymbol2) => new StaveNote({ keys, duration }).addModifier(chordSymbol1, 0).addModifier(chordSymbol2, 0);
|
|
355
|
-
const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).
|
|
355
|
+
const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).drawWithStyle();
|
|
356
356
|
const notes = [
|
|
357
357
|
note(['c/4', 'f/4', 'a/4'], 'q', chords[0], chords2[0]),
|
|
358
358
|
note(['c/4', 'e/4', 'b/4'], 'q', chords[1], chords2[1]).addModifier(f.Accidental({ type: 'b' }), 2),
|
|
@@ -381,7 +381,7 @@ function wide(options) {
|
|
|
381
381
|
const ctx = f.getContext();
|
|
382
382
|
ctx.scale(1.5, 1.5);
|
|
383
383
|
function draw(chord1, chord2, y) {
|
|
384
|
-
const stave = new Stave(10, y, 250).addClef('treble').setContext(ctx).
|
|
384
|
+
const stave = new Stave(10, y, 250).addClef('treble').setContext(ctx).drawWithStyle();
|
|
385
385
|
const notes = [
|
|
386
386
|
note(f, ['e/4', 'a/4', 'd/5'], 'h', chord1).addModifier(new Accidental('b'), 0),
|
|
387
387
|
note(f, ['c/4', 'e/4', 'B/4'], 'h', chord2),
|
|
@@ -4,11 +4,12 @@ const ClefTests = {
|
|
|
4
4
|
QUnit.module('Clef');
|
|
5
5
|
const run = VexFlowTests.runTests;
|
|
6
6
|
run('Bounding Box', draw, { drawBoundingBox: true });
|
|
7
|
+
run('Bounding Box Clef Change', drawClefChange, { drawBoundingBox: true });
|
|
7
8
|
run('Clef Test', draw, { drawBoundingBox: false });
|
|
8
9
|
run('Clef End Test', drawEnd);
|
|
9
10
|
run('Small Clef Test', drawSmall);
|
|
10
11
|
run('Small Clef End Test', drawSmallEnd);
|
|
11
|
-
run('Clef Change Test', drawClefChange);
|
|
12
|
+
run('Clef Change Test', drawClefChange, { drawBoundingBox: false });
|
|
12
13
|
},
|
|
13
14
|
};
|
|
14
15
|
function draw(options) {
|
|
@@ -131,6 +132,9 @@ function drawClefChange(options) {
|
|
|
131
132
|
const voice = f.Voice({ time: '12/4' }).addTickables(notes);
|
|
132
133
|
f.Formatter().joinVoices([voice]).formatToStave([voice], stave);
|
|
133
134
|
f.draw();
|
|
135
|
+
if (options.params.drawBoundingBox === true) {
|
|
136
|
+
notes.forEach((element) => VexFlowTests.drawBoundingBox(f.getContext(), element));
|
|
137
|
+
}
|
|
134
138
|
options.assert.ok(true, 'all pass');
|
|
135
139
|
}
|
|
136
140
|
VexFlowTests.register(ClefTests);
|
|
@@ -5,6 +5,8 @@ const CurveTests = {
|
|
|
5
5
|
QUnit.module('Curve');
|
|
6
6
|
const run = VexFlowTests.runTests;
|
|
7
7
|
run('Simple Curve', simple);
|
|
8
|
+
run('Opening Direction - up', openingDirUp);
|
|
9
|
+
run('Opening Direction - down', openingDirDown);
|
|
8
10
|
run('Rounded Curve', rounded);
|
|
9
11
|
run('Thick Thin Curves', thickThin);
|
|
10
12
|
run('Top Curve', top);
|
|
@@ -48,6 +50,38 @@ const simple = createTest(['c4/8, f5, d5, g5', { stem: 'up' }], ['d6/8, f5, d5,
|
|
|
48
50
|
},
|
|
49
51
|
}).setStyle({ lineDash: '10 10' });
|
|
50
52
|
});
|
|
53
|
+
const openingDirUp = createTest(['c4/8, f5, d5, g5', { stem: 'up' }], ['d6/8, f5, d5, g5', { stem: 'down' }], (f, notes) => {
|
|
54
|
+
f.Curve({
|
|
55
|
+
from: notes[0],
|
|
56
|
+
to: notes[3],
|
|
57
|
+
options: {
|
|
58
|
+
openingDirection: 'up',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
f.Curve({
|
|
62
|
+
from: notes[4],
|
|
63
|
+
to: notes[7],
|
|
64
|
+
options: {
|
|
65
|
+
openingDirection: 'up',
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
const openingDirDown = createTest(['c4/8, f5, d5, g5', { stem: 'up' }], ['d6/8, f5, d5, g5', { stem: 'down' }], (f, notes) => {
|
|
70
|
+
f.Curve({
|
|
71
|
+
from: notes[0],
|
|
72
|
+
to: notes[3],
|
|
73
|
+
options: {
|
|
74
|
+
openingDirection: 'down',
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
f.Curve({
|
|
78
|
+
from: notes[4],
|
|
79
|
+
to: notes[7],
|
|
80
|
+
options: {
|
|
81
|
+
openingDirection: 'down',
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
});
|
|
51
85
|
const rounded = createTest(['c5/8, f4, d4, g5', { stem: 'up' }], ['d5/8, d6, d6, g5', { stem: 'down' }], (f, notes) => {
|
|
52
86
|
f.Curve({
|
|
53
87
|
from: notes[0],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { concat, VexFlowTests } from './vexflow_test_helpers.js';
|
|
2
2
|
import { BarlineType, Registry } from '../src/index.js';
|
|
3
|
-
const
|
|
3
|
+
const DemoPetzoldTests = {
|
|
4
4
|
Start() {
|
|
5
|
-
QUnit.module('
|
|
6
|
-
VexFlowTests.runTests('Minuet
|
|
5
|
+
QUnit.module('Demo - Petzold');
|
|
6
|
+
VexFlowTests.runTests('Minuet in G', minuetInG);
|
|
7
7
|
},
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function minuetInG(options) {
|
|
10
10
|
const registry = new Registry();
|
|
11
11
|
Registry.enableDefaultRegistry(registry);
|
|
12
12
|
const id = (id) => registry.getElementById(id);
|
|
@@ -329,7 +329,7 @@ function minuet1(options) {
|
|
|
329
329
|
});
|
|
330
330
|
f.draw();
|
|
331
331
|
Registry.disableDefaultRegistry();
|
|
332
|
-
options.assert.ok(true, '
|
|
332
|
+
options.assert.ok(true, 'Petzold Minuet in G');
|
|
333
333
|
}
|
|
334
|
-
VexFlowTests.register(
|
|
335
|
-
export {
|
|
334
|
+
VexFlowTests.register(DemoPetzoldTests);
|
|
335
|
+
export { DemoPetzoldTests };
|
|
@@ -20,14 +20,14 @@ function showOneNote(note1, stave, ctx, x) {
|
|
|
20
20
|
const modifierContext = new ModifierContext();
|
|
21
21
|
note1.setStave(stave).addToModifierContext(modifierContext);
|
|
22
22
|
new TickContext().addTickable(note1).preFormat().setX(x);
|
|
23
|
-
note1.setContext(ctx).
|
|
23
|
+
note1.setContext(ctx).drawWithStyle();
|
|
24
24
|
Note.plotMetrics(ctx, note1, 140);
|
|
25
25
|
}
|
|
26
26
|
function basic(options, contextBuilder) {
|
|
27
27
|
const ctx = contextBuilder(options.elementId, 1000, 240);
|
|
28
28
|
const stave = new Stave(10, 10, 975);
|
|
29
29
|
stave.setContext(ctx);
|
|
30
|
-
stave.
|
|
30
|
+
stave.drawWithStyle();
|
|
31
31
|
const notes = [
|
|
32
32
|
new StaveNote({ keys: ['c/4', 'e/4', 'a/4', 'b/4'], duration: 'w' }),
|
|
33
33
|
new StaveNote({ keys: ['a/4', 'b/4', 'c/5'], duration: '4', stemDirection: 1 }),
|
|
@@ -71,13 +71,13 @@ function basic(options, contextBuilder) {
|
|
|
71
71
|
options.assert.ok(dots[j].getWidth() > 0, 'Dot ' + j + ' has width set');
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
beam.setContext(ctx).
|
|
74
|
+
beam.setContext(ctx).drawWithStyle();
|
|
75
75
|
VexFlowTests.plotLegendForNoteWidth(ctx, 890, 140);
|
|
76
76
|
options.assert.ok(true, 'Full Dot');
|
|
77
77
|
}
|
|
78
78
|
function multiVoice(options, contextBuilder) {
|
|
79
79
|
const ctx = contextBuilder(options.elementId, 750, 300);
|
|
80
|
-
const stave = new Stave(30, 45, 700).setContext(ctx).
|
|
80
|
+
const stave = new Stave(30, 45, 700).setContext(ctx).drawWithStyle();
|
|
81
81
|
const notes1 = [
|
|
82
82
|
new StaveNote({ keys: ['c/4', 'e/4', 'a/4'], duration: '2', stemDirection: -1 }),
|
|
83
83
|
new StaveNote({ keys: ['c/4', 'e/4', 'c/5'], duration: '2', stemDirection: -1 }),
|
|
@@ -102,7 +102,7 @@ function rightJustify(options) {
|
|
|
102
102
|
const stave = f.Stave({ x, y: 20, width });
|
|
103
103
|
const voice = getTickables(time, n, duration, duration2);
|
|
104
104
|
formatter.joinVoices([voice]).formatToStave([voice], stave);
|
|
105
|
-
stave.
|
|
105
|
+
stave.drawWithStyle();
|
|
106
106
|
voice.draw(f.getContext(), stave);
|
|
107
107
|
};
|
|
108
108
|
renderTest({ numBeats: 4, beatValue: 4, resolution: 4 * 4096 }, 3, '4', '2', 10, 300);
|
|
@@ -178,11 +178,11 @@ function noteHeadPadding(options) {
|
|
|
178
178
|
const staveWidth = width + Stave.defaultPadding;
|
|
179
179
|
const stave1 = f.Stave({ y: 50, width: staveWidth });
|
|
180
180
|
const stave2 = f.Stave({ y: 150, width: staveWidth });
|
|
181
|
-
stave1.
|
|
182
|
-
stave2.
|
|
181
|
+
stave1.drawWithStyle();
|
|
182
|
+
stave2.drawWithStyle();
|
|
183
183
|
voice1.draw(f.getContext(), stave1);
|
|
184
184
|
voice2.draw(f.getContext(), stave2);
|
|
185
|
-
beams.forEach((b) => b.setContext(f.getContext()).
|
|
185
|
+
beams.forEach((b) => b.setContext(f.getContext()).drawWithStyle());
|
|
186
186
|
options.assert.ok(true);
|
|
187
187
|
}
|
|
188
188
|
function longMeasureProblems(options) {
|
|
@@ -202,8 +202,8 @@ function longMeasureProblems(options) {
|
|
|
202
202
|
formatter.format([voice1, voice2], width);
|
|
203
203
|
const stave1 = f.Stave({ y: 50, width: width + Stave.defaultPadding });
|
|
204
204
|
const stave2 = f.Stave({ y: 200, width: width + Stave.defaultPadding });
|
|
205
|
-
stave1.
|
|
206
|
-
stave2.
|
|
205
|
+
stave1.drawWithStyle();
|
|
206
|
+
stave2.drawWithStyle();
|
|
207
207
|
voice1.draw(f.getContext(), stave1);
|
|
208
208
|
voice2.draw(f.getContext(), stave2);
|
|
209
209
|
options.assert.ok(true);
|
|
@@ -224,11 +224,11 @@ function accidentalJustification(options) {
|
|
|
224
224
|
const stave21 = f.Stave({ y: 130, width: width + Stave.defaultPadding });
|
|
225
225
|
formatter.format([voice11, voice21], width);
|
|
226
226
|
const ctx = f.getContext();
|
|
227
|
-
stave11.setContext(ctx).
|
|
228
|
-
stave21.setContext(ctx).
|
|
227
|
+
stave11.setContext(ctx).drawWithStyle();
|
|
228
|
+
stave21.setContext(ctx).drawWithStyle();
|
|
229
229
|
voice11.draw(ctx, stave11);
|
|
230
230
|
voice21.draw(ctx, stave21);
|
|
231
|
-
beams.forEach((b) => b.setContext(ctx).
|
|
231
|
+
beams.forEach((b) => b.setContext(ctx).drawWithStyle());
|
|
232
232
|
options.assert.ok(true);
|
|
233
233
|
}
|
|
234
234
|
function unalignedNoteDurations1(options) {
|
|
@@ -257,12 +257,12 @@ function unalignedNoteDurations1(options) {
|
|
|
257
257
|
const stave11 = f.Stave({ y: 20, width: width + Stave.defaultPadding });
|
|
258
258
|
const stave21 = f.Stave({ y: 130, width: width + Stave.defaultPadding });
|
|
259
259
|
formatter.format([voice11, voice21], width);
|
|
260
|
-
stave11.setContext(ctx).
|
|
261
|
-
stave21.setContext(ctx).
|
|
260
|
+
stave11.setContext(ctx).drawWithStyle();
|
|
261
|
+
stave21.setContext(ctx).drawWithStyle();
|
|
262
262
|
voice11.draw(ctx, stave11);
|
|
263
263
|
voice21.draw(ctx, stave21);
|
|
264
|
-
beams21.forEach((b) => b.setContext(ctx).
|
|
265
|
-
beams11.forEach((b) => b.setContext(ctx).
|
|
264
|
+
beams21.forEach((b) => b.setContext(ctx).drawWithStyle());
|
|
265
|
+
beams11.forEach((b) => b.setContext(ctx).drawWithStyle());
|
|
266
266
|
options.assert.ok(voice11.getTickables()[1].getX() > voice21.getTickables()[1].getX());
|
|
267
267
|
}
|
|
268
268
|
function unalignedNoteDurations2(options) {
|
|
@@ -303,8 +303,8 @@ function unalignedNoteDurations2(options) {
|
|
|
303
303
|
formatter.format([voice1, voice2], width);
|
|
304
304
|
const stave1 = new Stave(10, 40, width + Stave.defaultPadding);
|
|
305
305
|
const stave2 = new Stave(10, 100, width + Stave.defaultPadding);
|
|
306
|
-
stave1.setContext(context).
|
|
307
|
-
stave2.setContext(context).
|
|
306
|
+
stave1.setContext(context).drawWithStyle();
|
|
307
|
+
stave2.setContext(context).drawWithStyle();
|
|
308
308
|
voice1.draw(context, stave1);
|
|
309
309
|
voice2.draw(context, stave2);
|
|
310
310
|
options.assert.ok(voice1.getTickables()[1].getX() > voice2.getTickables()[1].getX());
|
|
@@ -355,10 +355,10 @@ function alignedMixedElements(options) {
|
|
|
355
355
|
const tuplet2 = new Tuplet(notes2).setTupletLocation(1);
|
|
356
356
|
Formatter.FormatAndDraw(context, stave, notes);
|
|
357
357
|
Formatter.FormatAndDraw(context, stave2, notes2);
|
|
358
|
-
stave.setContext(context).
|
|
359
|
-
stave2.setContext(context).
|
|
360
|
-
tuplet.setContext(context).
|
|
361
|
-
tuplet2.setContext(context).
|
|
358
|
+
stave.setContext(context).drawWithStyle();
|
|
359
|
+
stave2.setContext(context).drawWithStyle();
|
|
360
|
+
tuplet.setContext(context).drawWithStyle();
|
|
361
|
+
tuplet2.setContext(context).drawWithStyle();
|
|
362
362
|
options.assert.ok(true);
|
|
363
363
|
}
|
|
364
364
|
function justifyStaveNotes(options) {
|
|
@@ -458,10 +458,10 @@ function multiStaves(options) {
|
|
|
458
458
|
type: 'brace',
|
|
459
459
|
});
|
|
460
460
|
for (let i = 0; i < staves.length; ++i) {
|
|
461
|
-
staves[i].setContext(ctx).
|
|
461
|
+
staves[i].setContext(ctx).drawWithStyle();
|
|
462
462
|
voices[i].draw(ctx, staves[i]);
|
|
463
463
|
}
|
|
464
|
-
beams.forEach((beam) => beam.setContext(ctx).
|
|
464
|
+
beams.forEach((beam) => beam.setContext(ctx).drawWithStyle());
|
|
465
465
|
const notes12 = score.notes('ab4/4, bb4/8, (cb5 eb5)/4[stem="down"], d5/8[stem="down"]');
|
|
466
466
|
const notes22 = score.notes('(eb4 ab4)/4., (c4 eb4 ab4)/4, db5/8', { stem: 'up' });
|
|
467
467
|
const notes32 = score.notes('a5/8, a5, a5, a5, a5, a5', { stem: 'down' });
|
|
@@ -486,11 +486,11 @@ function multiStaves(options) {
|
|
|
486
486
|
new Beam(notes32.slice(3, 6), true),
|
|
487
487
|
];
|
|
488
488
|
for (let i = 0; i < staves.length; ++i) {
|
|
489
|
-
staves[i].setContext(ctx).
|
|
489
|
+
staves[i].setContext(ctx).drawWithStyle();
|
|
490
490
|
voices[i].draw(ctx, staves[i]);
|
|
491
491
|
voices[i].getTickables().forEach((note) => Note.plotMetrics(ctx, note, staveYs[i] - 20));
|
|
492
492
|
}
|
|
493
|
-
beams.forEach((beam) => beam.setContext(ctx).
|
|
493
|
+
beams.forEach((beam) => beam.setContext(ctx).drawWithStyle());
|
|
494
494
|
options.assert.ok(true);
|
|
495
495
|
}
|
|
496
496
|
function proportional(options) {
|
|
@@ -714,9 +714,9 @@ function annotations(options) {
|
|
|
714
714
|
const voice1 = new Voice({ numBeats: beats, beatValue: beatsPer }).setMode(Voice.Mode.SOFT).addTickables(notes);
|
|
715
715
|
const fmt = new Formatter({ softmaxFactor: sm.sm, maxIterations: 2 }).joinVoices([voice1]);
|
|
716
716
|
fmt.format([voice1], sm.width - 11);
|
|
717
|
-
stave.setContext(context).
|
|
717
|
+
stave.setContext(context).drawWithStyle();
|
|
718
718
|
voice1.draw(context, stave);
|
|
719
|
-
beams.forEach((b) => b.setContext(context).
|
|
719
|
+
beams.forEach((b) => b.setContext(context).drawWithStyle());
|
|
720
720
|
});
|
|
721
721
|
options.assert.ok(true);
|
|
722
722
|
}
|
|
@@ -8,6 +8,7 @@ const GlyphNoteTests = {
|
|
|
8
8
|
QUnit.module('GlyphNote');
|
|
9
9
|
const run = VexFlowTests.runTests;
|
|
10
10
|
run('GlyphNote with ChordSymbols', chordChanges, { debug: false, noPadding: false });
|
|
11
|
+
run('Bounding Box', chordChanges, { debug: false, noPadding: false, drawBoundingBox: true });
|
|
11
12
|
run('GlyphNote Positioning', basic, { debug: false, noPadding: false });
|
|
12
13
|
run('GlyphNote No Stave Padding', basic, { debug: true, noPadding: true });
|
|
13
14
|
run('GlyphNote RepeatNote', repeatNote, { debug: false, noPadding: true });
|
|
@@ -47,6 +48,11 @@ function chordChanges(options) {
|
|
|
47
48
|
system.addStave({ voices: [voice], debugNoteMetrics: options.params.debug });
|
|
48
49
|
system.addConnector().setType(StaveConnector.type.BRACKET);
|
|
49
50
|
f.draw();
|
|
51
|
+
if (options.params.drawBoundingBox === true) {
|
|
52
|
+
notes.forEach((note) => {
|
|
53
|
+
VexFlowTests.drawBoundingBox(f.getContext(), note);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
50
56
|
Registry.disableDefaultRegistry();
|
|
51
57
|
options.assert.ok(true);
|
|
52
58
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VexFlowTests } from './vexflow_test_helpers.js';
|
|
2
|
+
import { ModifierPosition } from '../src.js';
|
|
2
3
|
import { Accidental } from '../src/accidental.js';
|
|
3
4
|
import { Annotation } from '../src/annotation.js';
|
|
4
5
|
import { Articulation } from '../src/articulation.js';
|
|
@@ -78,7 +79,7 @@ function basic(options) {
|
|
|
78
79
|
.addModifier(f.GraceNoteGroup({ notes: gracenotes3 }).beamNotes(), 0),
|
|
79
80
|
f
|
|
80
81
|
.StaveNote({ keys: ['a/4'], duration: '4', autoStem: true })
|
|
81
|
-
.addModifier(f.GraceNoteGroup({ notes: gracenotes4 }).beamNotes(), 0),
|
|
82
|
+
.addModifier(f.GraceNoteGroup({ notes: gracenotes4 }).beamNotes().setPosition(ModifierPosition.RIGHT), 0),
|
|
82
83
|
];
|
|
83
84
|
const voice = f.Voice().setStrict(false).addTickables(notes);
|
|
84
85
|
new Formatter().joinVoices([voice]).formatToStave([voice], stave);
|
|
@@ -18,7 +18,7 @@ const tabNote = (noteStruct) => new TabNote(noteStruct);
|
|
|
18
18
|
const graceTabNote = (noteStruct) => new GraceTabNote(noteStruct);
|
|
19
19
|
function setupContext(opts, ctxBuilder) {
|
|
20
20
|
const context = ctxBuilder(opts.elementId, 350, 140);
|
|
21
|
-
const stave = new TabStave(10, 10, 350).addTabGlyph().setContext(context).
|
|
21
|
+
const stave = new TabStave(10, 10, 350).addTabGlyph().setContext(context).drawWithStyle();
|
|
22
22
|
return { context, stave };
|
|
23
23
|
}
|
|
24
24
|
function simple(options, contextBuilder) {
|
package/build/esm/tests/index.js
CHANGED
|
@@ -2,7 +2,6 @@ export * from './accidental_tests.js';
|
|
|
2
2
|
export * from './annotation_tests.js';
|
|
3
3
|
export * from './articulation_tests.js';
|
|
4
4
|
export * from './auto_beam_formatting_tests.js';
|
|
5
|
-
export * from './bach_tests.js';
|
|
6
5
|
export * from './barline_tests.js';
|
|
7
6
|
export * from './beam_tests.js';
|
|
8
7
|
export * from './bend_tests.js';
|
|
@@ -11,6 +10,7 @@ export * from './chordsymbol_tests.js';
|
|
|
11
10
|
export * from './clef_tests.js';
|
|
12
11
|
export * from './crossbeam_tests.js';
|
|
13
12
|
export * from './curve_tests.js';
|
|
13
|
+
export * from './demo_petzold_tests.js';
|
|
14
14
|
export * from './dot_tests.js';
|
|
15
15
|
export * from './easyscore_tests.js';
|
|
16
16
|
export * from './factory_tests.js';
|
|
@@ -63,9 +63,9 @@ function keys(options, contextBuilder) {
|
|
|
63
63
|
Stave.formatBegModifiers(staves);
|
|
64
64
|
for (i = 0; i < clefs.length; i++) {
|
|
65
65
|
staves[i].setContext(ctx);
|
|
66
|
-
staves[i].
|
|
66
|
+
staves[i].drawWithStyle();
|
|
67
67
|
staves[i + clefs.length].setContext(ctx);
|
|
68
|
-
staves[i + clefs.length].
|
|
68
|
+
staves[i + clefs.length].drawWithStyle();
|
|
69
69
|
}
|
|
70
70
|
options.assert.ok(true, 'all pass');
|
|
71
71
|
}
|
|
@@ -93,13 +93,13 @@ function staveHelper(options, contextBuilder) {
|
|
|
93
93
|
stave4.addKeySignature(keys[i]);
|
|
94
94
|
}
|
|
95
95
|
stave1.setContext(ctx);
|
|
96
|
-
stave1.
|
|
96
|
+
stave1.drawWithStyle();
|
|
97
97
|
stave2.setContext(ctx);
|
|
98
|
-
stave2.
|
|
98
|
+
stave2.drawWithStyle();
|
|
99
99
|
stave3.setContext(ctx);
|
|
100
|
-
stave3.
|
|
100
|
+
stave3.drawWithStyle();
|
|
101
101
|
stave4.setContext(ctx);
|
|
102
|
-
stave4.
|
|
102
|
+
stave4.drawWithStyle();
|
|
103
103
|
options.assert.ok(true, 'all pass');
|
|
104
104
|
}
|
|
105
105
|
VexFlowTests.register(ClefKeySignatureTests);
|
|
@@ -72,9 +72,12 @@ function majorKeys(options, contextBuilder) {
|
|
|
72
72
|
keySig.addToStave(stave2);
|
|
73
73
|
}
|
|
74
74
|
stave1.setContext(ctx);
|
|
75
|
-
stave1.
|
|
75
|
+
stave1.drawWithStyle();
|
|
76
|
+
stave1.getModifiers().forEach((modifier) => {
|
|
77
|
+
VexFlowTests.drawBoundingBox(ctx, modifier);
|
|
78
|
+
});
|
|
76
79
|
stave2.setContext(ctx);
|
|
77
|
-
stave2.
|
|
80
|
+
stave2.drawWithStyle();
|
|
78
81
|
options.assert.ok(true, 'all pass');
|
|
79
82
|
}
|
|
80
83
|
function majorKeysCanceled(options, contextBuilder) {
|
|
@@ -124,13 +127,13 @@ function majorKeysCanceled(options, contextBuilder) {
|
|
|
124
127
|
keySig.addToStave(stave4);
|
|
125
128
|
}
|
|
126
129
|
stave1.setContext(ctx);
|
|
127
|
-
stave1.
|
|
130
|
+
stave1.drawWithStyle();
|
|
128
131
|
stave2.setContext(ctx);
|
|
129
|
-
stave2.
|
|
132
|
+
stave2.drawWithStyle();
|
|
130
133
|
stave3.setContext(ctx);
|
|
131
|
-
stave3.
|
|
134
|
+
stave3.drawWithStyle();
|
|
132
135
|
stave4.setContext(ctx);
|
|
133
|
-
stave4.
|
|
136
|
+
stave4.drawWithStyle();
|
|
134
137
|
options.assert.ok(true, 'all pass');
|
|
135
138
|
}
|
|
136
139
|
function keysCanceledForEachClef(options, contextBuilder) {
|
|
@@ -161,7 +164,7 @@ function keysCanceledForEachClef(options, contextBuilder) {
|
|
|
161
164
|
stave.addKeySignature(cancelKey);
|
|
162
165
|
stave.addKeySignature(key, cancelKey);
|
|
163
166
|
stave.addKeySignature(key);
|
|
164
|
-
stave.setContext(ctx).
|
|
167
|
+
stave.setContext(ctx).drawWithStyle();
|
|
165
168
|
tx += width;
|
|
166
169
|
});
|
|
167
170
|
tx = x;
|
|
@@ -205,13 +208,13 @@ function majorKeysAltered(options, contextBuilder) {
|
|
|
205
208
|
keySig.addToStave(stave4);
|
|
206
209
|
}
|
|
207
210
|
stave1.setContext(ctx);
|
|
208
|
-
stave1.
|
|
211
|
+
stave1.drawWithStyle();
|
|
209
212
|
stave2.setContext(ctx);
|
|
210
|
-
stave2.
|
|
213
|
+
stave2.drawWithStyle();
|
|
211
214
|
stave3.setContext(ctx);
|
|
212
|
-
stave3.
|
|
215
|
+
stave3.drawWithStyle();
|
|
213
216
|
stave4.setContext(ctx);
|
|
214
|
-
stave4.
|
|
217
|
+
stave4.drawWithStyle();
|
|
215
218
|
options.assert.ok(true, 'all pass');
|
|
216
219
|
}
|
|
217
220
|
function minorKeys(options, contextBuilder) {
|
|
@@ -235,9 +238,9 @@ function minorKeys(options, contextBuilder) {
|
|
|
235
238
|
keySig.addToStave(stave2);
|
|
236
239
|
}
|
|
237
240
|
stave1.setContext(ctx);
|
|
238
|
-
stave1.
|
|
241
|
+
stave1.drawWithStyle();
|
|
239
242
|
stave2.setContext(ctx);
|
|
240
|
-
stave2.
|
|
243
|
+
stave2.drawWithStyle();
|
|
241
244
|
options.assert.ok(true, 'all pass');
|
|
242
245
|
}
|
|
243
246
|
function endKeyWithClef(options, contextBuilder) {
|
|
@@ -254,8 +257,8 @@ function endKeyWithClef(options, contextBuilder) {
|
|
|
254
257
|
.setEndKeySignature('Cb');
|
|
255
258
|
const stave2 = new Stave(10, 90, 350);
|
|
256
259
|
stave2.setKeySignature('Cb').setClef('bass').setEndClef('treble').setEndKeySignature('G');
|
|
257
|
-
stave1.setContext(ctx).
|
|
258
|
-
stave2.setContext(ctx).
|
|
260
|
+
stave1.setContext(ctx).drawWithStyle();
|
|
261
|
+
stave2.setContext(ctx).drawWithStyle();
|
|
259
262
|
options.assert.ok(true, 'all pass');
|
|
260
263
|
}
|
|
261
264
|
function staveHelper(options, contextBuilder) {
|
|
@@ -276,9 +279,9 @@ function staveHelper(options, contextBuilder) {
|
|
|
276
279
|
stave2.addKeySignature(keys[n]);
|
|
277
280
|
}
|
|
278
281
|
stave1.setContext(ctx);
|
|
279
|
-
stave1.
|
|
282
|
+
stave1.drawWithStyle();
|
|
280
283
|
stave2.setContext(ctx);
|
|
281
|
-
stave2.
|
|
284
|
+
stave2.drawWithStyle();
|
|
282
285
|
options.assert.ok(true, 'all pass');
|
|
283
286
|
}
|
|
284
287
|
function changeKey(options) {
|
|
@@ -27,7 +27,7 @@ function basic(options, contextBuilder) {
|
|
|
27
27
|
const ctx = contextBuilder(options.elementId, 450, 250);
|
|
28
28
|
setContextStyle(ctx);
|
|
29
29
|
const stave = new Stave(10, 0, 250).addClef('treble');
|
|
30
|
-
stave.setContext(ctx).
|
|
30
|
+
stave.setContext(ctx).drawWithStyle();
|
|
31
31
|
const formatter = new Formatter();
|
|
32
32
|
const voice = new Voice(VexFlow.TIME4_4).setStrict(false);
|
|
33
33
|
const noteHead1 = new NoteHead({ duration: '4', line: 3 });
|
|
@@ -41,7 +41,7 @@ function basic(options, contextBuilder) {
|
|
|
41
41
|
function showNote(noteStruct, stave, ctx, x) {
|
|
42
42
|
const note = new StaveNote(noteStruct).setStave(stave);
|
|
43
43
|
new TickContext().addTickable(note).preFormat().setX(x);
|
|
44
|
-
note.setContext(ctx).
|
|
44
|
+
note.setContext(ctx).drawWithStyle();
|
|
45
45
|
return note;
|
|
46
46
|
}
|
|
47
47
|
function variousHeads(options, contextBuilder) {
|
|
@@ -72,7 +72,7 @@ function variousHeads(options, contextBuilder) {
|
|
|
72
72
|
const stave = new Stave(10, 10 + staveNum * 120, notes.length * 25 + 75)
|
|
73
73
|
.addClef('percussion')
|
|
74
74
|
.setContext(ctx)
|
|
75
|
-
.
|
|
75
|
+
.drawWithStyle();
|
|
76
76
|
for (let i = 0; i < notes.length; ++i) {
|
|
77
77
|
const note = notes[i];
|
|
78
78
|
note.stemDirection = staveNum === 0 ? -1 : 1;
|
|
@@ -135,7 +135,7 @@ function variousNoteHeads(options, contextBuilder) {
|
|
|
135
135
|
const stave = new Stave(10, 10 + staveNum * 120, notes.length * 25 + 75)
|
|
136
136
|
.addClef('percussion')
|
|
137
137
|
.setContext(ctx)
|
|
138
|
-
.
|
|
138
|
+
.drawWithStyle();
|
|
139
139
|
for (let i = 0; i < notes.length; ++i) {
|
|
140
140
|
const note = notes[i];
|
|
141
141
|
note.stemDirection = staveNum === 0 ? -1 : 1;
|
|
@@ -157,7 +157,7 @@ function variousNoteHeads2(options, contextBuilder) {
|
|
|
157
157
|
{ keys: ['g/5/ti'], duration: '4', autoStem: true },
|
|
158
158
|
];
|
|
159
159
|
const ctx = contextBuilder(options.elementId, notes.length * 25 + 100, 240);
|
|
160
|
-
const stave = new Stave(10, 10, notes.length * 25 + 75).addClef('percussion').setContext(ctx).
|
|
160
|
+
const stave = new Stave(10, 10, notes.length * 25 + 75).addClef('percussion').setContext(ctx).drawWithStyle();
|
|
161
161
|
for (let i = 0; i < notes.length; ++i) {
|
|
162
162
|
const note = notes[i];
|
|
163
163
|
const staveNote = showNote(note, stave, ctx, (i + 1) * 25);
|
|
@@ -188,7 +188,10 @@ function drumChordHeads(options, contextBuilder) {
|
|
|
188
188
|
];
|
|
189
189
|
const ctx = contextBuilder(options.elementId, notes.length * 25 + 100, 240);
|
|
190
190
|
for (let h = 0; h < 2; ++h) {
|
|
191
|
-
const stave = new Stave(10, 10 + h * 120, notes.length * 25 + 75)
|
|
191
|
+
const stave = new Stave(10, 10 + h * 120, notes.length * 25 + 75)
|
|
192
|
+
.addClef('percussion')
|
|
193
|
+
.setContext(ctx)
|
|
194
|
+
.drawWithStyle();
|
|
192
195
|
for (let i = 0; i < notes.length; ++i) {
|
|
193
196
|
const note = notes[i];
|
|
194
197
|
note.stemDirection = h === 0 ? -1 : 1;
|
|
@@ -202,7 +205,7 @@ function basicBoundingBoxes(options, contextBuilder) {
|
|
|
202
205
|
const ctx = contextBuilder(options.elementId, 450, 250);
|
|
203
206
|
setContextStyle(ctx);
|
|
204
207
|
const stave = new Stave(10, 0, 250).addClef('treble');
|
|
205
|
-
stave.setContext(ctx).
|
|
208
|
+
stave.setContext(ctx).drawWithStyle();
|
|
206
209
|
const formatter = new Formatter();
|
|
207
210
|
const voice = new Voice(VexFlow.TIME4_4).setStrict(false);
|
|
208
211
|
const nh1 = new StaveNote({ keys: ['b/4'], duration: '4' });
|
|
@@ -23,7 +23,7 @@ function simpleTest(assert) {
|
|
|
23
23
|
const ctx = new CanvasContext(offscreenCtx);
|
|
24
24
|
const stave = new Stave(10, 50, 200);
|
|
25
25
|
stave.setEndBarType(BarlineType.END);
|
|
26
|
-
stave.addClef('treble').setContext(ctx).
|
|
26
|
+
stave.addClef('treble').setContext(ctx).drawWithStyle();
|
|
27
27
|
const notes = [
|
|
28
28
|
new StaveNote({ keys: ['c/4'], duration: 'q' }),
|
|
29
29
|
new StaveNote({ keys: ['d/4'], duration: 'q' }),
|