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.
Files changed (157) hide show
  1. package/build/cjs/vexflow-bravura.js +2 -2
  2. package/build/cjs/vexflow-bravura.js.map +1 -1
  3. package/build/cjs/vexflow-core.js +2 -2
  4. package/build/cjs/vexflow-core.js.map +1 -1
  5. package/build/cjs/vexflow-debug-with-tests.js +528 -492
  6. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  7. package/build/cjs/vexflow-debug.js +460 -452
  8. package/build/cjs/vexflow-debug.js.map +1 -1
  9. package/build/cjs/vexflow.js +2 -2
  10. package/build/cjs/vexflow.js.map +1 -1
  11. package/build/esm/src/accidental.js +22 -28
  12. package/build/esm/src/beam.js +24 -42
  13. package/build/esm/src/clefnote.js +6 -1
  14. package/build/esm/src/element.js +83 -101
  15. package/build/esm/src/fonts/gonville.js +1 -1
  16. package/build/esm/src/formatter.js +9 -17
  17. package/build/esm/src/fraction.js +15 -22
  18. package/build/esm/src/glyphnote.js +3 -2
  19. package/build/esm/src/metrics.js +3 -0
  20. package/build/esm/src/modifier.js +6 -21
  21. package/build/esm/src/multimeasurerest.js +16 -25
  22. package/build/esm/src/note.js +7 -0
  23. package/build/esm/src/registry.js +5 -19
  24. package/build/esm/src/stave.js +4 -6
  25. package/build/esm/src/stavenote.js +26 -40
  26. package/build/esm/src/stavetempo.js +4 -11
  27. package/build/esm/src/stavetie.js +82 -36
  28. package/build/esm/src/svgcontext.js +5 -12
  29. package/build/esm/src/tickable.js +13 -26
  30. package/build/esm/src/tickcontext.js +20 -2
  31. package/build/esm/src/version.js +3 -3
  32. package/build/esm/src/vibrato.js +6 -1
  33. package/build/esm/tests/clef_tests.js +5 -1
  34. package/build/esm/tests/glyphnote_tests.js +6 -0
  35. package/build/esm/tests/stavetie_tests.js +29 -0
  36. package/build/esm/tests/tabstave_tests.js +1 -0
  37. package/build/esm/tests/vexflow_test_helpers.js +25 -39
  38. package/build/types/src/accidental.d.ts +19 -1
  39. package/build/types/src/annotation.d.ts +1 -1
  40. package/build/types/src/beam.d.ts +12 -1
  41. package/build/types/src/clefnote.d.ts +2 -0
  42. package/build/types/src/element.d.ts +13 -3
  43. package/build/types/src/fonts/gonville.d.ts +1 -1
  44. package/build/types/src/formatter.d.ts +5 -3
  45. package/build/types/src/fraction.d.ts +12 -7
  46. package/build/types/src/modifier.d.ts +2 -1
  47. package/build/types/src/multimeasurerest.d.ts +4 -1
  48. package/build/types/src/note.d.ts +2 -0
  49. package/build/types/src/registry.d.ts +1 -1
  50. package/build/types/src/stavenote.d.ts +2 -1
  51. package/build/types/src/stavetempo.d.ts +3 -3
  52. package/build/types/src/stavetie.d.ts +39 -2
  53. package/build/types/src/svgcontext.d.ts +1 -1
  54. package/build/types/src/tickable.d.ts +2 -1
  55. package/build/types/src/tickcontext.d.ts +30 -0
  56. package/package.json +2 -4
  57. package/tests/flow.html +2 -2
  58. package/entry/vexflow-bravura.ts +0 -25
  59. package/entry/vexflow-core.ts +0 -16
  60. package/entry/vexflow-debug-with-tests.ts +0 -64
  61. package/entry/vexflow-debug.ts +0 -54
  62. package/entry/vexflow.ts +0 -47
  63. package/src/accidental.ts +0 -570
  64. package/src/annotation.ts +0 -294
  65. package/src/articulation.ts +0 -383
  66. package/src/barnote.ts +0 -95
  67. package/src/beam.ts +0 -999
  68. package/src/bend.ts +0 -268
  69. package/src/boundingbox.ts +0 -108
  70. package/src/canvascontext.ts +0 -348
  71. package/src/chordsymbol.ts +0 -473
  72. package/src/clef.ts +0 -164
  73. package/src/clefnote.ts +0 -50
  74. package/src/crescendo.ts +0 -132
  75. package/src/curve.ts +0 -195
  76. package/src/dot.ts +0 -171
  77. package/src/easyscore.ts +0 -538
  78. package/src/element.ts +0 -692
  79. package/src/factory.ts +0 -694
  80. package/src/font.ts +0 -343
  81. package/src/fonts/academico.ts +0 -2
  82. package/src/fonts/academicobold.ts +0 -2
  83. package/src/fonts/bravura.ts +0 -2
  84. package/src/fonts/gonville.ts +0 -2
  85. package/src/fonts/petaluma.ts +0 -2
  86. package/src/fonts/petalumascript.ts +0 -2
  87. package/src/formatter.ts +0 -1107
  88. package/src/fraction.ts +0 -245
  89. package/src/frethandfinger.ts +0 -180
  90. package/src/ghostnote.ts +0 -75
  91. package/src/glyphnote.ts +0 -68
  92. package/src/glyphs.ts +0 -5880
  93. package/src/gracenote.ts +0 -146
  94. package/src/gracenotegroup.ts +0 -194
  95. package/src/gracetabnote.ts +0 -30
  96. package/src/index.ts +0 -90
  97. package/src/keymanager.ts +0 -153
  98. package/src/keysignature.ts +0 -272
  99. package/src/keysignote.ts +0 -46
  100. package/src/metrics.ts +0 -222
  101. package/src/modifier.ts +0 -216
  102. package/src/modifiercontext.ts +0 -177
  103. package/src/multimeasurerest.ts +0 -229
  104. package/src/music.ts +0 -443
  105. package/src/note.ts +0 -690
  106. package/src/notehead.ts +0 -158
  107. package/src/notesubgroup.ts +0 -88
  108. package/src/ornament.ts +0 -301
  109. package/src/parenthesis.ts +0 -89
  110. package/src/parser.ts +0 -263
  111. package/src/pedalmarking.ts +0 -273
  112. package/src/registry.ts +0 -146
  113. package/src/rendercontext.ts +0 -98
  114. package/src/renderer.ts +0 -166
  115. package/src/repeatnote.ts +0 -25
  116. package/src/stave.ts +0 -885
  117. package/src/stavebarline.ts +0 -231
  118. package/src/staveconnector.ts +0 -281
  119. package/src/stavehairpin.ts +0 -209
  120. package/src/staveline.ts +0 -343
  121. package/src/stavemodifier.ts +0 -93
  122. package/src/stavenote.ts +0 -1230
  123. package/src/staverepetition.ts +0 -148
  124. package/src/stavesection.ts +0 -54
  125. package/src/stavetempo.ts +0 -162
  126. package/src/stavetext.ts +0 -69
  127. package/src/stavetie.ts +0 -235
  128. package/src/stavevolta.ts +0 -66
  129. package/src/stem.ts +0 -225
  130. package/src/stemmablenote.ts +0 -248
  131. package/src/stringnumber.ts +0 -286
  132. package/src/strokes.ts +0 -214
  133. package/src/svgcontext.ts +0 -639
  134. package/src/system.ts +0 -327
  135. package/src/tables.ts +0 -796
  136. package/src/tabnote.ts +0 -449
  137. package/src/tabslide.ts +0 -115
  138. package/src/tabstave.ts +0 -31
  139. package/src/tabtie.ts +0 -44
  140. package/src/textbracket.ts +0 -231
  141. package/src/textdynamics.ts +0 -101
  142. package/src/textnote.ts +0 -175
  143. package/src/tickable.ts +0 -374
  144. package/src/tickcontext.ts +0 -280
  145. package/src/timesignature.ts +0 -229
  146. package/src/timesignote.ts +0 -45
  147. package/src/tremolo.ts +0 -51
  148. package/src/tuning.ts +0 -90
  149. package/src/tuplet.ts +0 -349
  150. package/src/typeguard.ts +0 -136
  151. package/src/util.ts +0 -169
  152. package/src/version.ts +0 -4
  153. package/src/vexflow.ts +0 -378
  154. package/src/vibrato.ts +0 -99
  155. package/src/vibratobracket.ts +0 -81
  156. package/src/voice.ts +0 -302
  157. 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 (__classPrivateFieldGet(this, _a, "m", _Accidental_checkCollision).call(this, staveLineAccidentalLayoutMetrics[groupEnd], staveLineAccidentalLayoutMetrics[groupEnd + 1])) {
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]) => !__classPrivateFieldGet(this, _a, "m", _Accidental_checkCollision).call(this, 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 = __classPrivateFieldGet(this, _a, "m", _Accidental_checkCollision).call(this, staveLineAccidentalLayoutMetrics[groupStart], staveLineAccidentalLayoutMetrics[groupEnd])
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 (__classPrivateFieldGet(this, _a, "m", _Accidental_checkCollision).call(this, staveLineAccidentalLayoutMetrics[line], staveLineAccidentalLayoutMetrics[line + patternLength])) {
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 _a(accidentalString);
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;
@@ -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 __classPrivateFieldGet(this, _Beam_stemDirection, "f");
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
- _Beam_stemDirection.set(this, void 0);
293
- _Beam_ticks.set(this, void 0);
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
- __classPrivateFieldSet(this, _Beam_ticks, notes[0].getIntrinsicTicks(), "f");
306
- if (__classPrivateFieldGet(this, _Beam_ticks, "f") >= Tables.durationToTicks('4')) {
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
- __classPrivateFieldSet(this, _Beam_stemDirection, notes[0].getStemDirection(), "f");
312
- let stemDirection = __classPrivateFieldGet(this, _Beam_stemDirection, "f");
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
- __classPrivateFieldSet(this, _Beam_stemDirection, stemDirection, "f");
307
+ this._stemDirection = stemDirection;
325
308
  }
326
309
  note.setBeam(this);
327
310
  }
328
311
  this.postFormatted = false;
329
312
  this.notes = notes;
330
- __classPrivateFieldSet(this, _Beam_beamCount, this.getBeamCount(), "f");
331
- __classPrivateFieldSet(this, _Beam_breakOnIndexes, [], "f");
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
- __classPrivateFieldSet(this, _Beam_breakOnIndexes, indexes, "f");
337
+ this.breakOnIndexes = indexes;
355
338
  return this;
356
339
  }
357
340
  setPartialBeamSideAt(noteIndex, side) {
358
- __classPrivateFieldGet(this, _Beam_forcedPartialDirections, "f")[noteIndex] = side;
341
+ this.forcedPartialDirections[noteIndex] = side;
359
342
  return this;
360
343
  }
361
344
  unsetPartialBeamSideAt(noteIndex) {
362
- delete __classPrivateFieldGet(this, _Beam_forcedPartialDirections, "f")[noteIndex];
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 = __classPrivateFieldGet(this, _Beam_stemDirection, "f");
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
- __classPrivateFieldSet(this, _Beam_yShift, yShift, "f");
388
+ this.yShift = yShift;
406
389
  }
407
390
  calculateFlatSlope() {
408
391
  const { notes, renderOptions: { beamWidth, minFlatBeamOffset, flatBeamOffset }, } = this;
409
- const stemDirection = __classPrivateFieldGet(this, _Beam_stemDirection, "f");
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
- __classPrivateFieldSet(this, _Beam_yShift, 0, "f");
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 = __classPrivateFieldGet(this, _Beam_yShift, "f");
462
- const beamCount = __classPrivateFieldGet(this, _Beam_beamCount, "f");
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() !== __classPrivateFieldGet(this, _Beam_stemDirection, "f")) {
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 = __classPrivateFieldGet(this, _Beam_forcedPartialDirections, "f")[noteIndex];
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 = __classPrivateFieldGet(this, _Beam_breakOnIndexes, "f").indexOf(i) !== -1;
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 * __classPrivateFieldGet(this, _Beam_stemDirection, "f");
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 (__classPrivateFieldGet(this, _Beam_unbeamable, "f"))
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.renderText(ctx, this.getAbsoluteX() - this.x, stave.getYForLine(this.clef.line));
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
  }