@coderline/alphatab 1.8.0-alpha.1639 → 1.8.0-alpha.1640
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/dist/alphaTab.core.min.mjs +2 -2
- package/dist/alphaTab.core.mjs +70 -29
- package/dist/alphaTab.js +70 -29
- package/dist/alphaTab.min.js +2 -2
- package/dist/alphaTab.min.mjs +1 -1
- package/dist/alphaTab.mjs +1 -1
- package/dist/alphaTab.worker.min.mjs +1 -1
- package/dist/alphaTab.worker.mjs +1 -1
- package/dist/alphaTab.worklet.min.mjs +1 -1
- package/dist/alphaTab.worklet.mjs +1 -1
- package/package.json +1 -1
package/dist/alphaTab.core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab v1.8.0-alpha.
|
|
2
|
+
* alphaTab v1.8.0-alpha.1640 (develop, build 1640)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -203,9 +203,9 @@ class AlphaTabError extends Error {
|
|
|
203
203
|
* @internal
|
|
204
204
|
*/
|
|
205
205
|
class VersionInfo {
|
|
206
|
-
static version = '1.8.0-alpha.
|
|
207
|
-
static date = '2025-12-
|
|
208
|
-
static commit = '
|
|
206
|
+
static version = '1.8.0-alpha.1640';
|
|
207
|
+
static date = '2025-12-10T02:19:08.776Z';
|
|
208
|
+
static commit = '343f59ee6b39b4f3a41636b3c33db34bccf631f9';
|
|
209
209
|
static print(print) {
|
|
210
210
|
print(`alphaTab ${VersionInfo.version}`);
|
|
211
211
|
print(`commit: ${VersionInfo.commit}`);
|
|
@@ -48527,7 +48527,7 @@ class BeatContainerGlyph extends Glyph {
|
|
|
48527
48527
|
onNotes;
|
|
48528
48528
|
minWidth = 0;
|
|
48529
48529
|
get onTimeX() {
|
|
48530
|
-
return this.onNotes.x + this.onNotes.
|
|
48530
|
+
return this.onNotes.x + this.onNotes.onTimeX;
|
|
48531
48531
|
}
|
|
48532
48532
|
constructor(beat, voiceContainer) {
|
|
48533
48533
|
super(0, 0);
|
|
@@ -48551,8 +48551,8 @@ class BeatContainerGlyph extends Glyph {
|
|
|
48551
48551
|
return helper.hasFlag(false, undefined);
|
|
48552
48552
|
}
|
|
48553
48553
|
registerLayoutingInfo(layoutings) {
|
|
48554
|
-
const preBeatStretch = this.preNotes.computedWidth + this.onNotes.
|
|
48555
|
-
let postBeatStretch = this.onNotes.computedWidth - this.onNotes.
|
|
48554
|
+
const preBeatStretch = this.preNotes.computedWidth + this.onNotes.onTimeX;
|
|
48555
|
+
let postBeatStretch = this.onNotes.computedWidth - this.onNotes.onTimeX;
|
|
48556
48556
|
// make space for flag
|
|
48557
48557
|
const helper = this.renderer.helpers.getBeamingHelperForBeat(this.beat);
|
|
48558
48558
|
if (this.beat.graceType !== GraceType.None) {
|
|
@@ -48695,7 +48695,7 @@ class BeatContainerGlyph extends Glyph {
|
|
|
48695
48695
|
beatBoundings.realBounds.y = barBounds.realBounds.y;
|
|
48696
48696
|
beatBoundings.realBounds.w = this.width;
|
|
48697
48697
|
beatBoundings.realBounds.h = barBounds.realBounds.h;
|
|
48698
|
-
beatBoundings.onNotesX = cx + this.x + this.onNotes.
|
|
48698
|
+
beatBoundings.onNotesX = cx + this.x + this.onNotes.x + this.onNotes.onTimeX;
|
|
48699
48699
|
}
|
|
48700
48700
|
else {
|
|
48701
48701
|
beatBoundings.visualBounds = new Bounds();
|
|
@@ -48733,7 +48733,7 @@ class BeatContainerGlyph extends Glyph {
|
|
|
48733
48733
|
beatBoundings.realBounds.y = barBounds.realBounds.y;
|
|
48734
48734
|
beatBoundings.realBounds.w = this.width;
|
|
48735
48735
|
beatBoundings.realBounds.h = barBounds.realBounds.h;
|
|
48736
|
-
beatBoundings.onNotesX = cx + this.x + this.onNotes.x + this.onNotes.
|
|
48736
|
+
beatBoundings.onNotesX = cx + this.x + this.onNotes.x + this.onNotes.onTimeX;
|
|
48737
48737
|
}
|
|
48738
48738
|
barBounds.addBeat(beatBoundings);
|
|
48739
48739
|
if (this.renderer.settings.core.includeNoteBounds) {
|
|
@@ -54358,6 +54358,7 @@ class Cursors {
|
|
|
54358
54358
|
class ScalableHtmlElementContainer extends HtmlElementContainer {
|
|
54359
54359
|
_xscale;
|
|
54360
54360
|
_yscale;
|
|
54361
|
+
centerAtPosition = false;
|
|
54361
54362
|
constructor(element, xscale, yscale) {
|
|
54362
54363
|
super(element);
|
|
54363
54364
|
this._xscale = xscale;
|
|
@@ -54399,7 +54400,11 @@ class ScalableHtmlElementContainer extends HtmlElementContainer {
|
|
|
54399
54400
|
else {
|
|
54400
54401
|
h = h / this._yscale;
|
|
54401
54402
|
}
|
|
54402
|
-
|
|
54403
|
+
let transform = `translate(${x}px, ${y}px) scale(${w}, ${h})`;
|
|
54404
|
+
if (this.centerAtPosition) {
|
|
54405
|
+
transform += ` translateX(-50%)`;
|
|
54406
|
+
}
|
|
54407
|
+
this.element.style.transform = transform;
|
|
54403
54408
|
this.element.style.transformOrigin = 'top left';
|
|
54404
54409
|
this.lastBounds.x = x;
|
|
54405
54410
|
this.lastBounds.y = y;
|
|
@@ -55260,6 +55265,7 @@ class BrowserUiFacade {
|
|
|
55260
55265
|
beatCursor.style.willChange = 'transform';
|
|
55261
55266
|
beatCursorContainer.width = 3;
|
|
55262
55267
|
beatCursorContainer.height = 1;
|
|
55268
|
+
beatCursorContainer.centerAtPosition = true;
|
|
55263
55269
|
beatCursorContainer.setBounds(0, 0, 1, 1);
|
|
55264
55270
|
// add cursors to UI
|
|
55265
55271
|
element.insertBefore(cursorWrapper, element.firstChild);
|
|
@@ -56634,7 +56640,7 @@ var BeatXPosition;
|
|
|
56634
56640
|
*/
|
|
56635
56641
|
BeatXPosition[BeatXPosition["OnNotes"] = 1] = "OnNotes";
|
|
56636
56642
|
/**
|
|
56637
|
-
* Gets the middle-notes position which is located after in the
|
|
56643
|
+
* Gets the middle-notes position which is located after in the exact center of the note heads.
|
|
56638
56644
|
*/
|
|
56639
56645
|
BeatXPosition[BeatXPosition["MiddleNotes"] = 2] = "MiddleNotes";
|
|
56640
56646
|
/**
|
|
@@ -61813,7 +61819,8 @@ class BeatGlyphBase extends GlyphGroup {
|
|
|
61813
61819
|
*/
|
|
61814
61820
|
class BeatOnNoteGlyphBase extends BeatGlyphBase {
|
|
61815
61821
|
beamingHelper;
|
|
61816
|
-
|
|
61822
|
+
onTimeX = 0;
|
|
61823
|
+
middleX = 0;
|
|
61817
61824
|
updateBeamingHelper() {
|
|
61818
61825
|
}
|
|
61819
61826
|
buildBoundingsLookup(_beatBounds, _cx, _cy) {
|
|
@@ -63149,7 +63156,7 @@ class BarRendererBase {
|
|
|
63149
63156
|
case BeatXPosition.OnNotes:
|
|
63150
63157
|
return container.voiceContainer.x + container.x + container.onNotes.x;
|
|
63151
63158
|
case BeatXPosition.MiddleNotes:
|
|
63152
|
-
return container.voiceContainer.x + container.x + container.
|
|
63159
|
+
return container.voiceContainer.x + container.x + container.onNotes.x + container.onNotes.middleX;
|
|
63153
63160
|
case BeatXPosition.Stem:
|
|
63154
63161
|
const offset = container.onNotes.beamingHelper
|
|
63155
63162
|
? container.onNotes.beamingHelper.getBeatLineX(beat)
|
|
@@ -67215,14 +67222,15 @@ class NumberedBeatGlyph extends BeatOnNoteGlyphBase {
|
|
|
67215
67222
|
}
|
|
67216
67223
|
super.doLayout();
|
|
67217
67224
|
if (this.container.beat.isEmpty) {
|
|
67218
|
-
this.
|
|
67225
|
+
this.onTimeX = this.width / 2;
|
|
67219
67226
|
}
|
|
67220
67227
|
else if (this.noteHeads) {
|
|
67221
|
-
this.
|
|
67228
|
+
this.onTimeX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
67222
67229
|
}
|
|
67223
67230
|
else if (this.deadSlapped) {
|
|
67224
|
-
this.
|
|
67231
|
+
this.onTimeX = this.deadSlapped.x + this.deadSlapped.width / 2;
|
|
67225
67232
|
}
|
|
67233
|
+
this.middleX = this.onTimeX;
|
|
67226
67234
|
}
|
|
67227
67235
|
}
|
|
67228
67236
|
|
|
@@ -68088,6 +68096,7 @@ class ScoreNoteChordGlyphBase extends Glyph {
|
|
|
68088
68096
|
upLineX = 0;
|
|
68089
68097
|
downLineX = 0;
|
|
68090
68098
|
noteStartX = 0;
|
|
68099
|
+
onTimeX = 0;
|
|
68091
68100
|
constructor() {
|
|
68092
68101
|
super(0, 0);
|
|
68093
68102
|
}
|
|
@@ -68174,6 +68183,8 @@ class ScoreNoteChordGlyphBase extends Glyph {
|
|
|
68174
68183
|
// align all notes so that they align with the stem positions
|
|
68175
68184
|
const stemPosition = anyDisplaced || direction === BeamDirection.Up ? stemUpX : stemDownX;
|
|
68176
68185
|
let w = 0;
|
|
68186
|
+
let displacedWidth = 0;
|
|
68187
|
+
let nonDisplacedWidth = 0;
|
|
68177
68188
|
for (let i = 0, j = this._infos.length; i < j; i++) {
|
|
68178
68189
|
const g = this._infos[i].glyph;
|
|
68179
68190
|
const alignDisplaced = displaced.get(i);
|
|
@@ -68189,7 +68200,14 @@ class ScoreNoteChordGlyphBase extends Glyph {
|
|
|
68189
68200
|
}
|
|
68190
68201
|
}
|
|
68191
68202
|
g.x += this.noteStartX;
|
|
68192
|
-
|
|
68203
|
+
const gw = g.x + g.width;
|
|
68204
|
+
w = Math.max(w, gw);
|
|
68205
|
+
if (alignDisplaced) {
|
|
68206
|
+
displacedWidth = Math.max(displacedWidth, gw);
|
|
68207
|
+
}
|
|
68208
|
+
else {
|
|
68209
|
+
nonDisplacedWidth = Math.max(nonDisplacedWidth, gw);
|
|
68210
|
+
}
|
|
68193
68211
|
// after size calculation, re-align glyph to stem if needed
|
|
68194
68212
|
if (g instanceof NoteHeadGlyph && g.centerOnStem) {
|
|
68195
68213
|
g.x = stemPosition;
|
|
@@ -68203,6 +68221,23 @@ class ScoreNoteChordGlyphBase extends Glyph {
|
|
|
68203
68221
|
this.upLineX = stemUpX;
|
|
68204
68222
|
this.downLineX = stemDownX;
|
|
68205
68223
|
}
|
|
68224
|
+
// the center of score notes, (used for aligning the beat to the right on-time position)
|
|
68225
|
+
// is always the center of the "correct note" position.
|
|
68226
|
+
// * If the stem is upwards, the center is the middle of the left hand side note head
|
|
68227
|
+
// * If the stem is downards, the center is the middle of the right-hand-side note head
|
|
68228
|
+
if (anyDisplaced) {
|
|
68229
|
+
if (direction === BeamDirection.Up) {
|
|
68230
|
+
this.onTimeX = nonDisplacedWidth / 2;
|
|
68231
|
+
}
|
|
68232
|
+
else {
|
|
68233
|
+
const displacedRawWith = displacedWidth - stemPosition;
|
|
68234
|
+
this.onTimeX = stemPosition + (displacedRawWith / 2);
|
|
68235
|
+
}
|
|
68236
|
+
}
|
|
68237
|
+
else {
|
|
68238
|
+
// for no displaced notes it is simply the center
|
|
68239
|
+
this.onTimeX = w / 2;
|
|
68240
|
+
}
|
|
68206
68241
|
this.width = w;
|
|
68207
68242
|
}
|
|
68208
68243
|
paint(cx, cy, canvas) {
|
|
@@ -68379,6 +68414,7 @@ class ScoreNoteChordGlyph extends ScoreNoteChordGlyphBase {
|
|
|
68379
68414
|
this._deadSlapped.renderer = this.renderer;
|
|
68380
68415
|
this._deadSlapped.doLayout();
|
|
68381
68416
|
this.width = this._deadSlapped.width;
|
|
68417
|
+
this.onTimeX = this.width / 2;
|
|
68382
68418
|
}
|
|
68383
68419
|
let aboveBeatEffectsY = 0;
|
|
68384
68420
|
let belowBeatEffectsY = 0;
|
|
@@ -69277,13 +69313,16 @@ class ScoreBeatGlyph extends BeatOnNoteGlyphBase {
|
|
|
69277
69313
|
}
|
|
69278
69314
|
super.doLayout();
|
|
69279
69315
|
if (this.container.beat.isEmpty) {
|
|
69280
|
-
this.
|
|
69316
|
+
this.onTimeX = this.width / 2;
|
|
69317
|
+
this.middleX = this.onTimeX;
|
|
69281
69318
|
}
|
|
69282
69319
|
else if (this.restGlyph) {
|
|
69283
|
-
this.
|
|
69320
|
+
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
69321
|
+
this.middleX = this.onTimeX;
|
|
69284
69322
|
}
|
|
69285
69323
|
else if (this.noteHeads) {
|
|
69286
|
-
this.
|
|
69324
|
+
this.onTimeX = this.noteHeads.x + this.noteHeads.onTimeX;
|
|
69325
|
+
this.middleX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
69287
69326
|
}
|
|
69288
69327
|
}
|
|
69289
69328
|
_createBeatDot(line, group) {
|
|
@@ -71059,17 +71098,18 @@ class SlashBeatGlyph extends BeatOnNoteGlyphBase {
|
|
|
71059
71098
|
}
|
|
71060
71099
|
super.doLayout();
|
|
71061
71100
|
if (this.container.beat.isEmpty) {
|
|
71062
|
-
this.
|
|
71101
|
+
this.onTimeX = this.width / 2;
|
|
71063
71102
|
}
|
|
71064
71103
|
else if (this.restGlyph) {
|
|
71065
|
-
this.
|
|
71104
|
+
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
71066
71105
|
}
|
|
71067
71106
|
else if (this.noteHeads) {
|
|
71068
|
-
this.
|
|
71107
|
+
this.onTimeX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
71069
71108
|
}
|
|
71070
71109
|
else if (this.deadSlapped) {
|
|
71071
|
-
this.
|
|
71110
|
+
this.onTimeX = this.deadSlapped.x + this.deadSlapped.width / 2;
|
|
71072
71111
|
}
|
|
71112
|
+
this.middleX = this.onTimeX;
|
|
71073
71113
|
}
|
|
71074
71114
|
}
|
|
71075
71115
|
|
|
@@ -71982,19 +72022,20 @@ class TabBeatGlyph extends BeatOnNoteGlyphBase {
|
|
|
71982
72022
|
this.width = w;
|
|
71983
72023
|
this.computedWidth = w;
|
|
71984
72024
|
if (this.container.beat.isEmpty) {
|
|
71985
|
-
this.
|
|
72025
|
+
this.onTimeX = this.width / 2;
|
|
71986
72026
|
}
|
|
71987
72027
|
else if (this.restGlyph) {
|
|
71988
|
-
this.
|
|
72028
|
+
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
71989
72029
|
}
|
|
71990
72030
|
else if (this.noteNumbers) {
|
|
71991
|
-
this.
|
|
72031
|
+
this.onTimeX = this.noteNumbers.x + this.noteNumbers.noteStringWidth / 2;
|
|
71992
72032
|
}
|
|
71993
72033
|
else if (this.slash) {
|
|
71994
|
-
this.
|
|
72034
|
+
this.onTimeX = this.slash.x + this.slash.width / 2;
|
|
71995
72035
|
}
|
|
72036
|
+
this.middleX = this.onTimeX;
|
|
71996
72037
|
for (const g of centeredEffectGlyphs) {
|
|
71997
|
-
g.x = this.
|
|
72038
|
+
g.x = this.onTimeX;
|
|
71998
72039
|
}
|
|
71999
72040
|
}
|
|
72000
72041
|
updateBeamingHelper() {
|
package/dist/alphaTab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab v1.8.0-alpha.
|
|
2
|
+
* alphaTab v1.8.0-alpha.1640 (develop, build 1640)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -209,9 +209,9 @@
|
|
|
209
209
|
* @internal
|
|
210
210
|
*/
|
|
211
211
|
class VersionInfo {
|
|
212
|
-
static version = '1.8.0-alpha.
|
|
213
|
-
static date = '2025-12-
|
|
214
|
-
static commit = '
|
|
212
|
+
static version = '1.8.0-alpha.1640';
|
|
213
|
+
static date = '2025-12-10T02:19:08.776Z';
|
|
214
|
+
static commit = '343f59ee6b39b4f3a41636b3c33db34bccf631f9';
|
|
215
215
|
static print(print) {
|
|
216
216
|
print(`alphaTab ${VersionInfo.version}`);
|
|
217
217
|
print(`commit: ${VersionInfo.commit}`);
|
|
@@ -48533,7 +48533,7 @@
|
|
|
48533
48533
|
onNotes;
|
|
48534
48534
|
minWidth = 0;
|
|
48535
48535
|
get onTimeX() {
|
|
48536
|
-
return this.onNotes.x + this.onNotes.
|
|
48536
|
+
return this.onNotes.x + this.onNotes.onTimeX;
|
|
48537
48537
|
}
|
|
48538
48538
|
constructor(beat, voiceContainer) {
|
|
48539
48539
|
super(0, 0);
|
|
@@ -48557,8 +48557,8 @@
|
|
|
48557
48557
|
return helper.hasFlag(false, undefined);
|
|
48558
48558
|
}
|
|
48559
48559
|
registerLayoutingInfo(layoutings) {
|
|
48560
|
-
const preBeatStretch = this.preNotes.computedWidth + this.onNotes.
|
|
48561
|
-
let postBeatStretch = this.onNotes.computedWidth - this.onNotes.
|
|
48560
|
+
const preBeatStretch = this.preNotes.computedWidth + this.onNotes.onTimeX;
|
|
48561
|
+
let postBeatStretch = this.onNotes.computedWidth - this.onNotes.onTimeX;
|
|
48562
48562
|
// make space for flag
|
|
48563
48563
|
const helper = this.renderer.helpers.getBeamingHelperForBeat(this.beat);
|
|
48564
48564
|
if (this.beat.graceType !== GraceType.None) {
|
|
@@ -48701,7 +48701,7 @@
|
|
|
48701
48701
|
beatBoundings.realBounds.y = barBounds.realBounds.y;
|
|
48702
48702
|
beatBoundings.realBounds.w = this.width;
|
|
48703
48703
|
beatBoundings.realBounds.h = barBounds.realBounds.h;
|
|
48704
|
-
beatBoundings.onNotesX = cx + this.x + this.onNotes.
|
|
48704
|
+
beatBoundings.onNotesX = cx + this.x + this.onNotes.x + this.onNotes.onTimeX;
|
|
48705
48705
|
}
|
|
48706
48706
|
else {
|
|
48707
48707
|
beatBoundings.visualBounds = new Bounds();
|
|
@@ -48739,7 +48739,7 @@
|
|
|
48739
48739
|
beatBoundings.realBounds.y = barBounds.realBounds.y;
|
|
48740
48740
|
beatBoundings.realBounds.w = this.width;
|
|
48741
48741
|
beatBoundings.realBounds.h = barBounds.realBounds.h;
|
|
48742
|
-
beatBoundings.onNotesX = cx + this.x + this.onNotes.x + this.onNotes.
|
|
48742
|
+
beatBoundings.onNotesX = cx + this.x + this.onNotes.x + this.onNotes.onTimeX;
|
|
48743
48743
|
}
|
|
48744
48744
|
barBounds.addBeat(beatBoundings);
|
|
48745
48745
|
if (this.renderer.settings.core.includeNoteBounds) {
|
|
@@ -54364,6 +54364,7 @@
|
|
|
54364
54364
|
class ScalableHtmlElementContainer extends HtmlElementContainer {
|
|
54365
54365
|
_xscale;
|
|
54366
54366
|
_yscale;
|
|
54367
|
+
centerAtPosition = false;
|
|
54367
54368
|
constructor(element, xscale, yscale) {
|
|
54368
54369
|
super(element);
|
|
54369
54370
|
this._xscale = xscale;
|
|
@@ -54405,7 +54406,11 @@
|
|
|
54405
54406
|
else {
|
|
54406
54407
|
h = h / this._yscale;
|
|
54407
54408
|
}
|
|
54408
|
-
|
|
54409
|
+
let transform = `translate(${x}px, ${y}px) scale(${w}, ${h})`;
|
|
54410
|
+
if (this.centerAtPosition) {
|
|
54411
|
+
transform += ` translateX(-50%)`;
|
|
54412
|
+
}
|
|
54413
|
+
this.element.style.transform = transform;
|
|
54409
54414
|
this.element.style.transformOrigin = 'top left';
|
|
54410
54415
|
this.lastBounds.x = x;
|
|
54411
54416
|
this.lastBounds.y = y;
|
|
@@ -55266,6 +55271,7 @@
|
|
|
55266
55271
|
beatCursor.style.willChange = 'transform';
|
|
55267
55272
|
beatCursorContainer.width = 3;
|
|
55268
55273
|
beatCursorContainer.height = 1;
|
|
55274
|
+
beatCursorContainer.centerAtPosition = true;
|
|
55269
55275
|
beatCursorContainer.setBounds(0, 0, 1, 1);
|
|
55270
55276
|
// add cursors to UI
|
|
55271
55277
|
element.insertBefore(cursorWrapper, element.firstChild);
|
|
@@ -56640,7 +56646,7 @@
|
|
|
56640
56646
|
*/
|
|
56641
56647
|
BeatXPosition[BeatXPosition["OnNotes"] = 1] = "OnNotes";
|
|
56642
56648
|
/**
|
|
56643
|
-
* Gets the middle-notes position which is located after in the
|
|
56649
|
+
* Gets the middle-notes position which is located after in the exact center of the note heads.
|
|
56644
56650
|
*/
|
|
56645
56651
|
BeatXPosition[BeatXPosition["MiddleNotes"] = 2] = "MiddleNotes";
|
|
56646
56652
|
/**
|
|
@@ -61819,7 +61825,8 @@
|
|
|
61819
61825
|
*/
|
|
61820
61826
|
class BeatOnNoteGlyphBase extends BeatGlyphBase {
|
|
61821
61827
|
beamingHelper;
|
|
61822
|
-
|
|
61828
|
+
onTimeX = 0;
|
|
61829
|
+
middleX = 0;
|
|
61823
61830
|
updateBeamingHelper() {
|
|
61824
61831
|
}
|
|
61825
61832
|
buildBoundingsLookup(_beatBounds, _cx, _cy) {
|
|
@@ -63155,7 +63162,7 @@
|
|
|
63155
63162
|
case BeatXPosition.OnNotes:
|
|
63156
63163
|
return container.voiceContainer.x + container.x + container.onNotes.x;
|
|
63157
63164
|
case BeatXPosition.MiddleNotes:
|
|
63158
|
-
return container.voiceContainer.x + container.x + container.
|
|
63165
|
+
return container.voiceContainer.x + container.x + container.onNotes.x + container.onNotes.middleX;
|
|
63159
63166
|
case BeatXPosition.Stem:
|
|
63160
63167
|
const offset = container.onNotes.beamingHelper
|
|
63161
63168
|
? container.onNotes.beamingHelper.getBeatLineX(beat)
|
|
@@ -67221,14 +67228,15 @@
|
|
|
67221
67228
|
}
|
|
67222
67229
|
super.doLayout();
|
|
67223
67230
|
if (this.container.beat.isEmpty) {
|
|
67224
|
-
this.
|
|
67231
|
+
this.onTimeX = this.width / 2;
|
|
67225
67232
|
}
|
|
67226
67233
|
else if (this.noteHeads) {
|
|
67227
|
-
this.
|
|
67234
|
+
this.onTimeX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
67228
67235
|
}
|
|
67229
67236
|
else if (this.deadSlapped) {
|
|
67230
|
-
this.
|
|
67237
|
+
this.onTimeX = this.deadSlapped.x + this.deadSlapped.width / 2;
|
|
67231
67238
|
}
|
|
67239
|
+
this.middleX = this.onTimeX;
|
|
67232
67240
|
}
|
|
67233
67241
|
}
|
|
67234
67242
|
|
|
@@ -68094,6 +68102,7 @@
|
|
|
68094
68102
|
upLineX = 0;
|
|
68095
68103
|
downLineX = 0;
|
|
68096
68104
|
noteStartX = 0;
|
|
68105
|
+
onTimeX = 0;
|
|
68097
68106
|
constructor() {
|
|
68098
68107
|
super(0, 0);
|
|
68099
68108
|
}
|
|
@@ -68180,6 +68189,8 @@
|
|
|
68180
68189
|
// align all notes so that they align with the stem positions
|
|
68181
68190
|
const stemPosition = anyDisplaced || direction === BeamDirection.Up ? stemUpX : stemDownX;
|
|
68182
68191
|
let w = 0;
|
|
68192
|
+
let displacedWidth = 0;
|
|
68193
|
+
let nonDisplacedWidth = 0;
|
|
68183
68194
|
for (let i = 0, j = this._infos.length; i < j; i++) {
|
|
68184
68195
|
const g = this._infos[i].glyph;
|
|
68185
68196
|
const alignDisplaced = displaced.get(i);
|
|
@@ -68195,7 +68206,14 @@
|
|
|
68195
68206
|
}
|
|
68196
68207
|
}
|
|
68197
68208
|
g.x += this.noteStartX;
|
|
68198
|
-
|
|
68209
|
+
const gw = g.x + g.width;
|
|
68210
|
+
w = Math.max(w, gw);
|
|
68211
|
+
if (alignDisplaced) {
|
|
68212
|
+
displacedWidth = Math.max(displacedWidth, gw);
|
|
68213
|
+
}
|
|
68214
|
+
else {
|
|
68215
|
+
nonDisplacedWidth = Math.max(nonDisplacedWidth, gw);
|
|
68216
|
+
}
|
|
68199
68217
|
// after size calculation, re-align glyph to stem if needed
|
|
68200
68218
|
if (g instanceof NoteHeadGlyph && g.centerOnStem) {
|
|
68201
68219
|
g.x = stemPosition;
|
|
@@ -68209,6 +68227,23 @@
|
|
|
68209
68227
|
this.upLineX = stemUpX;
|
|
68210
68228
|
this.downLineX = stemDownX;
|
|
68211
68229
|
}
|
|
68230
|
+
// the center of score notes, (used for aligning the beat to the right on-time position)
|
|
68231
|
+
// is always the center of the "correct note" position.
|
|
68232
|
+
// * If the stem is upwards, the center is the middle of the left hand side note head
|
|
68233
|
+
// * If the stem is downards, the center is the middle of the right-hand-side note head
|
|
68234
|
+
if (anyDisplaced) {
|
|
68235
|
+
if (direction === BeamDirection.Up) {
|
|
68236
|
+
this.onTimeX = nonDisplacedWidth / 2;
|
|
68237
|
+
}
|
|
68238
|
+
else {
|
|
68239
|
+
const displacedRawWith = displacedWidth - stemPosition;
|
|
68240
|
+
this.onTimeX = stemPosition + (displacedRawWith / 2);
|
|
68241
|
+
}
|
|
68242
|
+
}
|
|
68243
|
+
else {
|
|
68244
|
+
// for no displaced notes it is simply the center
|
|
68245
|
+
this.onTimeX = w / 2;
|
|
68246
|
+
}
|
|
68212
68247
|
this.width = w;
|
|
68213
68248
|
}
|
|
68214
68249
|
paint(cx, cy, canvas) {
|
|
@@ -68385,6 +68420,7 @@
|
|
|
68385
68420
|
this._deadSlapped.renderer = this.renderer;
|
|
68386
68421
|
this._deadSlapped.doLayout();
|
|
68387
68422
|
this.width = this._deadSlapped.width;
|
|
68423
|
+
this.onTimeX = this.width / 2;
|
|
68388
68424
|
}
|
|
68389
68425
|
let aboveBeatEffectsY = 0;
|
|
68390
68426
|
let belowBeatEffectsY = 0;
|
|
@@ -69283,13 +69319,16 @@
|
|
|
69283
69319
|
}
|
|
69284
69320
|
super.doLayout();
|
|
69285
69321
|
if (this.container.beat.isEmpty) {
|
|
69286
|
-
this.
|
|
69322
|
+
this.onTimeX = this.width / 2;
|
|
69323
|
+
this.middleX = this.onTimeX;
|
|
69287
69324
|
}
|
|
69288
69325
|
else if (this.restGlyph) {
|
|
69289
|
-
this.
|
|
69326
|
+
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
69327
|
+
this.middleX = this.onTimeX;
|
|
69290
69328
|
}
|
|
69291
69329
|
else if (this.noteHeads) {
|
|
69292
|
-
this.
|
|
69330
|
+
this.onTimeX = this.noteHeads.x + this.noteHeads.onTimeX;
|
|
69331
|
+
this.middleX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
69293
69332
|
}
|
|
69294
69333
|
}
|
|
69295
69334
|
_createBeatDot(line, group) {
|
|
@@ -71065,17 +71104,18 @@
|
|
|
71065
71104
|
}
|
|
71066
71105
|
super.doLayout();
|
|
71067
71106
|
if (this.container.beat.isEmpty) {
|
|
71068
|
-
this.
|
|
71107
|
+
this.onTimeX = this.width / 2;
|
|
71069
71108
|
}
|
|
71070
71109
|
else if (this.restGlyph) {
|
|
71071
|
-
this.
|
|
71110
|
+
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
71072
71111
|
}
|
|
71073
71112
|
else if (this.noteHeads) {
|
|
71074
|
-
this.
|
|
71113
|
+
this.onTimeX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
71075
71114
|
}
|
|
71076
71115
|
else if (this.deadSlapped) {
|
|
71077
|
-
this.
|
|
71116
|
+
this.onTimeX = this.deadSlapped.x + this.deadSlapped.width / 2;
|
|
71078
71117
|
}
|
|
71118
|
+
this.middleX = this.onTimeX;
|
|
71079
71119
|
}
|
|
71080
71120
|
}
|
|
71081
71121
|
|
|
@@ -71988,19 +72028,20 @@
|
|
|
71988
72028
|
this.width = w;
|
|
71989
72029
|
this.computedWidth = w;
|
|
71990
72030
|
if (this.container.beat.isEmpty) {
|
|
71991
|
-
this.
|
|
72031
|
+
this.onTimeX = this.width / 2;
|
|
71992
72032
|
}
|
|
71993
72033
|
else if (this.restGlyph) {
|
|
71994
|
-
this.
|
|
72034
|
+
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
71995
72035
|
}
|
|
71996
72036
|
else if (this.noteNumbers) {
|
|
71997
|
-
this.
|
|
72037
|
+
this.onTimeX = this.noteNumbers.x + this.noteNumbers.noteStringWidth / 2;
|
|
71998
72038
|
}
|
|
71999
72039
|
else if (this.slash) {
|
|
72000
|
-
this.
|
|
72040
|
+
this.onTimeX = this.slash.x + this.slash.width / 2;
|
|
72001
72041
|
}
|
|
72042
|
+
this.middleX = this.onTimeX;
|
|
72002
72043
|
for (const g of centeredEffectGlyphs) {
|
|
72003
|
-
g.x = this.
|
|
72044
|
+
g.x = this.onTimeX;
|
|
72004
72045
|
}
|
|
72005
72046
|
}
|
|
72006
72047
|
updateBeamingHelper() {
|