vexflow 5.0.0-alpha.2 → 5.0.0-alpha.4
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/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 +528 -492
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +460 -452
- 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/beam.js +24 -42
- package/build/esm/src/clefnote.js +6 -1
- package/build/esm/src/element.js +83 -101
- package/build/esm/src/fonts/gonville.js +1 -1
- package/build/esm/src/formatter.js +9 -17
- package/build/esm/src/fraction.js +15 -22
- package/build/esm/src/glyphnote.js +3 -2
- package/build/esm/src/metrics.js +3 -0
- package/build/esm/src/modifier.js +6 -21
- package/build/esm/src/multimeasurerest.js +16 -25
- package/build/esm/src/note.js +7 -0
- package/build/esm/src/registry.js +5 -19
- package/build/esm/src/stave.js +4 -6
- package/build/esm/src/stavenote.js +26 -40
- package/build/esm/src/stavetempo.js +4 -11
- package/build/esm/src/stavetie.js +82 -36
- package/build/esm/src/svgcontext.js +5 -12
- package/build/esm/src/tickable.js +13 -26
- package/build/esm/src/tickcontext.js +20 -2
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vibrato.js +6 -1
- package/build/esm/tests/clef_tests.js +5 -1
- package/build/esm/tests/glyphnote_tests.js +6 -0
- package/build/esm/tests/stavetie_tests.js +29 -0
- package/build/esm/tests/tabstave_tests.js +1 -0
- package/build/esm/tests/vexflow_test_helpers.js +25 -39
- 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/clefnote.d.ts +2 -0
- package/build/types/src/element.d.ts +13 -3
- 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/modifier.d.ts +2 -1
- package/build/types/src/multimeasurerest.d.ts +4 -1
- package/build/types/src/note.d.ts +2 -0
- package/build/types/src/registry.d.ts +1 -1
- package/build/types/src/stavenote.d.ts +2 -1
- package/build/types/src/stavetempo.d.ts +3 -3
- package/build/types/src/stavetie.d.ts +39 -2
- 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/package.json +2 -4
- package/tests/flow.html +2 -2
- package/entry/vexflow-bravura.ts +0 -25
- package/entry/vexflow-core.ts +0 -16
- package/entry/vexflow-debug-with-tests.ts +0 -64
- package/entry/vexflow-debug.ts +0 -54
- package/entry/vexflow.ts +0 -47
- package/src/accidental.ts +0 -570
- package/src/annotation.ts +0 -294
- package/src/articulation.ts +0 -383
- package/src/barnote.ts +0 -95
- package/src/beam.ts +0 -999
- package/src/bend.ts +0 -268
- package/src/boundingbox.ts +0 -108
- package/src/canvascontext.ts +0 -348
- package/src/chordsymbol.ts +0 -473
- package/src/clef.ts +0 -164
- package/src/clefnote.ts +0 -50
- package/src/crescendo.ts +0 -132
- package/src/curve.ts +0 -195
- package/src/dot.ts +0 -171
- package/src/easyscore.ts +0 -538
- package/src/element.ts +0 -692
- package/src/factory.ts +0 -694
- package/src/font.ts +0 -343
- package/src/fonts/academico.ts +0 -2
- package/src/fonts/academicobold.ts +0 -2
- package/src/fonts/bravura.ts +0 -2
- package/src/fonts/gonville.ts +0 -2
- package/src/fonts/petaluma.ts +0 -2
- package/src/fonts/petalumascript.ts +0 -2
- package/src/formatter.ts +0 -1107
- package/src/fraction.ts +0 -245
- package/src/frethandfinger.ts +0 -180
- package/src/ghostnote.ts +0 -75
- package/src/glyphnote.ts +0 -68
- package/src/glyphs.ts +0 -5880
- package/src/gracenote.ts +0 -146
- package/src/gracenotegroup.ts +0 -194
- package/src/gracetabnote.ts +0 -30
- package/src/index.ts +0 -90
- package/src/keymanager.ts +0 -153
- package/src/keysignature.ts +0 -272
- package/src/keysignote.ts +0 -46
- package/src/metrics.ts +0 -222
- package/src/modifier.ts +0 -216
- package/src/modifiercontext.ts +0 -177
- package/src/multimeasurerest.ts +0 -229
- package/src/music.ts +0 -443
- package/src/note.ts +0 -690
- package/src/notehead.ts +0 -158
- package/src/notesubgroup.ts +0 -88
- package/src/ornament.ts +0 -301
- package/src/parenthesis.ts +0 -89
- package/src/parser.ts +0 -263
- package/src/pedalmarking.ts +0 -273
- package/src/registry.ts +0 -146
- package/src/rendercontext.ts +0 -98
- package/src/renderer.ts +0 -166
- package/src/repeatnote.ts +0 -25
- package/src/stave.ts +0 -885
- package/src/stavebarline.ts +0 -231
- package/src/staveconnector.ts +0 -281
- package/src/stavehairpin.ts +0 -209
- package/src/staveline.ts +0 -343
- package/src/stavemodifier.ts +0 -93
- package/src/stavenote.ts +0 -1230
- package/src/staverepetition.ts +0 -148
- package/src/stavesection.ts +0 -54
- package/src/stavetempo.ts +0 -162
- package/src/stavetext.ts +0 -69
- package/src/stavetie.ts +0 -235
- package/src/stavevolta.ts +0 -66
- package/src/stem.ts +0 -225
- package/src/stemmablenote.ts +0 -248
- package/src/stringnumber.ts +0 -286
- package/src/strokes.ts +0 -214
- package/src/svgcontext.ts +0 -639
- package/src/system.ts +0 -327
- package/src/tables.ts +0 -796
- package/src/tabnote.ts +0 -449
- package/src/tabslide.ts +0 -115
- package/src/tabstave.ts +0 -31
- package/src/tabtie.ts +0 -44
- package/src/textbracket.ts +0 -231
- package/src/textdynamics.ts +0 -101
- package/src/textnote.ts +0 -175
- package/src/tickable.ts +0 -374
- package/src/tickcontext.ts +0 -280
- package/src/timesignature.ts +0 -229
- package/src/timesignote.ts +0 -45
- package/src/tremolo.ts +0 -51
- package/src/tuning.ts +0 -90
- package/src/tuplet.ts +0 -349
- package/src/typeguard.ts +0 -136
- package/src/util.ts +0 -169
- package/src/version.ts +0 -4
- package/src/vexflow.ts +0 -378
- package/src/vibrato.ts +0 -99
- package/src/vibratobracket.ts +0 -81
- package/src/voice.ts +0 -302
- package/src/web.ts +0 -35
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _a, _Accidental_checkCollision;
|
|
7
1
|
import { Fraction } from './fraction.js';
|
|
8
2
|
import { Metrics } from './metrics.js';
|
|
9
3
|
import { Modifier } from './modifier.js';
|
|
@@ -99,7 +93,7 @@ export class Accidental extends Modifier {
|
|
|
99
93
|
const groupStart = i;
|
|
100
94
|
let groupEnd = i;
|
|
101
95
|
while (groupEnd + 1 < staveLineAccidentalLayoutMetrics.length && !noFurtherConflicts) {
|
|
102
|
-
if (
|
|
96
|
+
if (this.checkCollision(staveLineAccidentalLayoutMetrics[groupEnd], staveLineAccidentalLayoutMetrics[groupEnd + 1])) {
|
|
103
97
|
groupEnd++;
|
|
104
98
|
}
|
|
105
99
|
else {
|
|
@@ -112,9 +106,9 @@ export class Accidental extends Modifier {
|
|
|
112
106
|
const [a, b] = getGroupLines([indexA, indexB]).map((item) => item.line);
|
|
113
107
|
return a - b;
|
|
114
108
|
};
|
|
115
|
-
const notColliding = (...indexPairs) => indexPairs.map(getGroupLines).every(([line1, line2]) => !
|
|
109
|
+
const notColliding = (...indexPairs) => indexPairs.map(getGroupLines).every(([line1, line2]) => !this.checkCollision(line1, line2));
|
|
116
110
|
const groupLength = groupEnd - groupStart + 1;
|
|
117
|
-
let endCase =
|
|
111
|
+
let endCase = this.checkCollision(staveLineAccidentalLayoutMetrics[groupStart], staveLineAccidentalLayoutMetrics[groupEnd])
|
|
118
112
|
? 'a'
|
|
119
113
|
: 'b';
|
|
120
114
|
switch (groupLength) {
|
|
@@ -155,7 +149,7 @@ export class Accidental extends Modifier {
|
|
|
155
149
|
while (collisionDetected === true) {
|
|
156
150
|
collisionDetected = false;
|
|
157
151
|
for (let line = 0; line + patternLength < staveLineAccidentalLayoutMetrics.length; line++) {
|
|
158
|
-
if (
|
|
152
|
+
if (this.checkCollision(staveLineAccidentalLayoutMetrics[line], staveLineAccidentalLayoutMetrics[line + patternLength])) {
|
|
159
153
|
collisionDetected = true;
|
|
160
154
|
patternLength++;
|
|
161
155
|
break;
|
|
@@ -206,6 +200,23 @@ export class Accidental extends Modifier {
|
|
|
206
200
|
});
|
|
207
201
|
state.leftShift = totalShift + additionalPadding;
|
|
208
202
|
}
|
|
203
|
+
static checkCollision(line1, line2) {
|
|
204
|
+
let clearance = line2.line - line1.line;
|
|
205
|
+
let clearanceRequired = 3;
|
|
206
|
+
if (clearance > 0) {
|
|
207
|
+
clearanceRequired = line2.flatLine || line2.dblSharpLine ? 2.5 : 3.0;
|
|
208
|
+
if (line1.dblSharpLine)
|
|
209
|
+
clearance -= 0.5;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
clearanceRequired = line1.flatLine || line1.dblSharpLine ? 2.5 : 3.0;
|
|
213
|
+
if (line2.dblSharpLine)
|
|
214
|
+
clearance -= 0.5;
|
|
215
|
+
}
|
|
216
|
+
const collision = Math.abs(clearance) < clearanceRequired;
|
|
217
|
+
L('Line1, Line2, Collision: ', line1.line, line2.line, collision);
|
|
218
|
+
return collision;
|
|
219
|
+
}
|
|
209
220
|
static applyAccidentals(voices, keySignature) {
|
|
210
221
|
const tickPositions = [];
|
|
211
222
|
const tickNoteMap = {};
|
|
@@ -255,7 +266,7 @@ export class Accidental extends Modifier {
|
|
|
255
266
|
});
|
|
256
267
|
if (!sameAccidental || (sameAccidental && previouslyModified)) {
|
|
257
268
|
scaleMap[key.root + octave] = pitch;
|
|
258
|
-
const accidental = new
|
|
269
|
+
const accidental = new Accidental(accidentalString);
|
|
259
270
|
staveNote.addModifier(accidental, keyIndex);
|
|
260
271
|
modifiedPitches.push(keyString);
|
|
261
272
|
}
|
|
@@ -316,21 +327,4 @@ export class Accidental extends Modifier {
|
|
|
316
327
|
this.renderText(ctx, 0, 0);
|
|
317
328
|
}
|
|
318
329
|
}
|
|
319
|
-
_a = Accidental, _Accidental_checkCollision = function _Accidental_checkCollision(line1, line2) {
|
|
320
|
-
let clearance = line2.line - line1.line;
|
|
321
|
-
let clearanceRequired = 3;
|
|
322
|
-
if (clearance > 0) {
|
|
323
|
-
clearanceRequired = line2.flatLine || line2.dblSharpLine ? 2.5 : 3.0;
|
|
324
|
-
if (line1.dblSharpLine)
|
|
325
|
-
clearance -= 0.5;
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
clearanceRequired = line1.flatLine || line1.dblSharpLine ? 2.5 : 3.0;
|
|
329
|
-
if (line2.dblSharpLine)
|
|
330
|
-
clearance -= 0.5;
|
|
331
|
-
}
|
|
332
|
-
const collision = Math.abs(clearance) < clearanceRequired;
|
|
333
|
-
L('Line1, Line2, Collision: ', line1.line, line2.line, collision);
|
|
334
|
-
return collision;
|
|
335
|
-
};
|
|
336
330
|
Accidental.DEBUG = false;
|
package/build/esm/src/beam.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _Beam_stemDirection, _Beam_ticks, _Beam_yShift, _Beam_breakOnIndexes, _Beam_beamCount, _Beam_unbeamable, _Beam_forcedPartialDirections;
|
|
13
1
|
import { Element } from './element.js';
|
|
14
2
|
import { Fraction } from './fraction.js';
|
|
15
3
|
import { Stem } from './stem.js';
|
|
@@ -45,7 +33,7 @@ export class Beam extends Element {
|
|
|
45
33
|
return "Beam";
|
|
46
34
|
}
|
|
47
35
|
getStemDirection() {
|
|
48
|
-
return
|
|
36
|
+
return this._stemDirection;
|
|
49
37
|
}
|
|
50
38
|
static getDefaultBeamGroups(timeSig) {
|
|
51
39
|
if (!timeSig || timeSig === 'c') {
|
|
@@ -289,27 +277,22 @@ export class Beam extends Element {
|
|
|
289
277
|
constructor(notes, autoStem = false) {
|
|
290
278
|
super();
|
|
291
279
|
this.slope = 0;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
_Beam_yShift.set(this, 0);
|
|
295
|
-
_Beam_breakOnIndexes.set(this, void 0);
|
|
296
|
-
_Beam_beamCount.set(this, void 0);
|
|
297
|
-
_Beam_unbeamable.set(this, void 0);
|
|
298
|
-
_Beam_forcedPartialDirections.set(this, {});
|
|
280
|
+
this.yShift = 0;
|
|
281
|
+
this.forcedPartialDirections = {};
|
|
299
282
|
if (!notes || notes.length === 0) {
|
|
300
283
|
throw new RuntimeError('BadArguments', 'No notes provided for beam.');
|
|
301
284
|
}
|
|
302
285
|
if (notes.length === 1) {
|
|
303
286
|
throw new RuntimeError('BadArguments', 'Too few notes for beam.');
|
|
304
287
|
}
|
|
305
|
-
|
|
306
|
-
if (
|
|
288
|
+
this._ticks = notes[0].getIntrinsicTicks();
|
|
289
|
+
if (this._ticks >= Tables.durationToTicks('4')) {
|
|
307
290
|
throw new RuntimeError('BadArguments', 'Beams can only be applied to notes shorter than a quarter note.');
|
|
308
291
|
}
|
|
309
292
|
let i;
|
|
310
293
|
let note;
|
|
311
|
-
|
|
312
|
-
let stemDirection =
|
|
294
|
+
this._stemDirection = notes[0].getStemDirection();
|
|
295
|
+
let stemDirection = this._stemDirection;
|
|
313
296
|
if (autoStem && isStaveNote(notes[0])) {
|
|
314
297
|
stemDirection = calculateStemDirection(notes);
|
|
315
298
|
}
|
|
@@ -321,14 +304,14 @@ export class Beam extends Element {
|
|
|
321
304
|
note = notes[i];
|
|
322
305
|
if (autoStem) {
|
|
323
306
|
note.setStemDirection(stemDirection);
|
|
324
|
-
|
|
307
|
+
this._stemDirection = stemDirection;
|
|
325
308
|
}
|
|
326
309
|
note.setBeam(this);
|
|
327
310
|
}
|
|
328
311
|
this.postFormatted = false;
|
|
329
312
|
this.notes = notes;
|
|
330
|
-
|
|
331
|
-
|
|
313
|
+
this._beamCount = this.getBeamCount();
|
|
314
|
+
this.breakOnIndexes = [];
|
|
332
315
|
this.renderOptions = {
|
|
333
316
|
beamWidth: 5,
|
|
334
317
|
maxSlope: 0.25,
|
|
@@ -351,15 +334,15 @@ export class Beam extends Element {
|
|
|
351
334
|
return maxBeamCount;
|
|
352
335
|
}
|
|
353
336
|
breakSecondaryAt(indexes) {
|
|
354
|
-
|
|
337
|
+
this.breakOnIndexes = indexes;
|
|
355
338
|
return this;
|
|
356
339
|
}
|
|
357
340
|
setPartialBeamSideAt(noteIndex, side) {
|
|
358
|
-
|
|
341
|
+
this.forcedPartialDirections[noteIndex] = side;
|
|
359
342
|
return this;
|
|
360
343
|
}
|
|
361
344
|
unsetPartialBeamSideAt(noteIndex) {
|
|
362
|
-
delete
|
|
345
|
+
delete this.forcedPartialDirections[noteIndex];
|
|
363
346
|
return this;
|
|
364
347
|
}
|
|
365
348
|
getSlopeY(x, firstX, firstY, slope) {
|
|
@@ -367,7 +350,7 @@ export class Beam extends Element {
|
|
|
367
350
|
}
|
|
368
351
|
calculateSlope() {
|
|
369
352
|
const { notes, renderOptions: { maxSlope, minSlope, slopeIterations, slopeCost }, } = this;
|
|
370
|
-
const stemDirection =
|
|
353
|
+
const stemDirection = this._stemDirection;
|
|
371
354
|
const firstNote = notes[0];
|
|
372
355
|
const initialSlope = getStemSlope(firstNote, notes[notes.length - 1]);
|
|
373
356
|
const increment = (maxSlope - minSlope) / slopeIterations;
|
|
@@ -402,11 +385,11 @@ export class Beam extends Element {
|
|
|
402
385
|
}
|
|
403
386
|
}
|
|
404
387
|
this.slope = bestSlope;
|
|
405
|
-
|
|
388
|
+
this.yShift = yShift;
|
|
406
389
|
}
|
|
407
390
|
calculateFlatSlope() {
|
|
408
391
|
const { notes, renderOptions: { beamWidth, minFlatBeamOffset, flatBeamOffset }, } = this;
|
|
409
|
-
const stemDirection =
|
|
392
|
+
const stemDirection = this._stemDirection;
|
|
410
393
|
let total = 0;
|
|
411
394
|
let extremeY = 0;
|
|
412
395
|
let extremeBeamCount = 0;
|
|
@@ -445,7 +428,7 @@ export class Beam extends Element {
|
|
|
445
428
|
this.renderOptions.flatBeamOffset = offset;
|
|
446
429
|
}
|
|
447
430
|
this.slope = 0;
|
|
448
|
-
|
|
431
|
+
this.yShift = 0;
|
|
449
432
|
}
|
|
450
433
|
getBeamYToDraw() {
|
|
451
434
|
const firstNote = this.notes[0];
|
|
@@ -458,8 +441,8 @@ export class Beam extends Element {
|
|
|
458
441
|
}
|
|
459
442
|
applyStemExtensions() {
|
|
460
443
|
const { notes, slope, renderOptions: { showStemlets, stemletExtension, beamWidth }, } = this;
|
|
461
|
-
const yShift =
|
|
462
|
-
const beamCount =
|
|
444
|
+
const yShift = this.yShift;
|
|
445
|
+
const beamCount = this._beamCount;
|
|
463
446
|
const firstNote = notes[0];
|
|
464
447
|
const firstStemTipY = this.getBeamYToDraw();
|
|
465
448
|
const firstStemX = firstNote.getStemX();
|
|
@@ -473,7 +456,7 @@ export class Beam extends Element {
|
|
|
473
456
|
const preBeamExtension = stem.getExtension();
|
|
474
457
|
const beamExtension = note.getStemDirection() === Stem.UP ? stemTipY - beamedStemTipY : beamedStemTipY - stemTipY;
|
|
475
458
|
let crossStemExtension = 0;
|
|
476
|
-
if (note.getStemDirection() !==
|
|
459
|
+
if (note.getStemDirection() !== this._stemDirection) {
|
|
477
460
|
const beamCount = note.getGlyphProps().beamCount;
|
|
478
461
|
crossStemExtension = (1 + (beamCount - 1) * 1.5) * this.renderOptions.beamWidth;
|
|
479
462
|
}
|
|
@@ -490,7 +473,7 @@ export class Beam extends Element {
|
|
|
490
473
|
if (duration === '4') {
|
|
491
474
|
return BEAM_LEFT;
|
|
492
475
|
}
|
|
493
|
-
const forcedBeamDirection =
|
|
476
|
+
const forcedBeamDirection = this.forcedPartialDirections[noteIndex];
|
|
494
477
|
if (forcedBeamDirection)
|
|
495
478
|
return forcedBeamDirection;
|
|
496
479
|
const lookupDuration = `${Tables.durationToNumber(duration) / 2}`;
|
|
@@ -522,7 +505,7 @@ export class Beam extends Element {
|
|
|
522
505
|
tickTally += ticks;
|
|
523
506
|
let shouldBreak = false;
|
|
524
507
|
if (parseInt(duration, 10) >= 8) {
|
|
525
|
-
shouldBreak =
|
|
508
|
+
shouldBreak = this.breakOnIndexes.indexOf(i) !== -1;
|
|
526
509
|
if (this.renderOptions.secondaryBreakTicks && tickTally >= this.renderOptions.secondaryBreakTicks) {
|
|
527
510
|
tickTally = 0;
|
|
528
511
|
shouldBreak = true;
|
|
@@ -602,7 +585,7 @@ export class Beam extends Element {
|
|
|
602
585
|
const firstNote = this.notes[0];
|
|
603
586
|
let beamY = this.getBeamYToDraw();
|
|
604
587
|
const firstStemX = firstNote.getStemX();
|
|
605
|
-
const beamThickness = this.renderOptions.beamWidth *
|
|
588
|
+
const beamThickness = this.renderOptions.beamWidth * this._stemDirection;
|
|
606
589
|
for (let i = 0; i < validBeamDurations.length; ++i) {
|
|
607
590
|
const duration = validBeamDurations[i];
|
|
608
591
|
const beamLines = this.getBeamLines(duration);
|
|
@@ -646,7 +629,7 @@ export class Beam extends Element {
|
|
|
646
629
|
draw() {
|
|
647
630
|
const ctx = this.checkContext();
|
|
648
631
|
this.setRendered();
|
|
649
|
-
if (
|
|
632
|
+
if (this.unbeamable)
|
|
650
633
|
return;
|
|
651
634
|
if (!this.postFormatted) {
|
|
652
635
|
this.postFormat();
|
|
@@ -659,4 +642,3 @@ export class Beam extends Element {
|
|
|
659
642
|
this.restoreStyle();
|
|
660
643
|
}
|
|
661
644
|
}
|
|
662
|
-
_Beam_stemDirection = new WeakMap(), _Beam_ticks = new WeakMap(), _Beam_yShift = new WeakMap(), _Beam_breakOnIndexes = new WeakMap(), _Beam_beamCount = new WeakMap(), _Beam_unbeamable = new WeakMap(), _Beam_forcedPartialDirections = new WeakMap();
|
|
@@ -25,6 +25,11 @@ export class ClefNote extends Note {
|
|
|
25
25
|
const stave = this.checkStave();
|
|
26
26
|
const ctx = this.checkContext();
|
|
27
27
|
this.setRendered();
|
|
28
|
-
this.clef.
|
|
28
|
+
this.clef.setX(this.getAbsoluteX());
|
|
29
|
+
this.clef.setY(stave.getYForLine(this.clef.line));
|
|
30
|
+
this.clef.renderText(ctx, 0, 0);
|
|
31
|
+
}
|
|
32
|
+
getBoundingBox() {
|
|
33
|
+
return this.clef.getBoundingBox();
|
|
29
34
|
}
|
|
30
35
|
}
|