Skip to content

Commit abc38b9

Browse files
committed
fix: wrong scaling on horizontal layout
1 parent dfb3fee commit abc38b9

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

packages/alphatab/src/importer/alphaTex/AlphaTex1LanguageHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
import {
2626
AlphaTexDiagnosticCode,
2727
AlphaTexDiagnosticsSeverity,
28-
StaffNoteKind,
28+
AlphaTexStaffNoteKind,
2929
type IAlphaTexImporter
3030
} from '@src/importer/alphaTex/AlphaTexShared';
3131
import { Atnf } from '@src/importer/alphaTex/ATNF';
@@ -319,7 +319,7 @@ export class AlphaTex1LanguageHandler implements IAlphaTexLanguageImportHandler
319319
case 'piano':
320320
case 'none':
321321
case 'voice':
322-
importer.applyStaffNoteKind(staff, StaffNoteKind.Pitched);
322+
importer.applyStaffNoteKind(staff, AlphaTexStaffNoteKind.Pitched);
323323
i = metaData.values!.values.length;
324324
break;
325325
// backwards compatibility only
@@ -1125,7 +1125,7 @@ export class AlphaTex1LanguageHandler implements IAlphaTexLanguageImportHandler
11251125
const instrumentName = (values!.values[0] as AlphaTexTextNode).text.toLowerCase();
11261126
if (instrumentName === 'percussion') {
11271127
for (const staff of track.staves) {
1128-
importer.applyStaffNoteKind(staff, StaffNoteKind.Articulation);
1128+
importer.applyStaffNoteKind(staff, AlphaTexStaffNoteKind.Articulation);
11291129
}
11301130
track.playbackInfo.primaryChannel = SynthConstants.PercussionChannel;
11311131
track.playbackInfo.secondaryChannel = SynthConstants.PercussionChannel;

packages/alphatab/src/importer/alphaTex/_barrel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export {
4242
AlphaTexDiagnosticBag,
4343
AlphaTexDiagnosticCode,
4444
AlphaTexDiagnosticsSeverity,
45+
AlphaTexStaffNoteKind,
4546
type IAlphaTexImporter,
46-
type IAlphaTexImporterState,
47-
AlphaTexStaffNoteKind
47+
type IAlphaTexImporterState
4848
} from '@src/importer/alphaTex/AlphaTexShared';

packages/alphatab/src/rendering/layout/HorizontalScreenLayout.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,8 @@ export class HorizontalScreenLayout extends ScoreLayout {
133133
}
134134
this._finalizeStaffSystem();
135135

136-
const scale = this.renderer.settings.display.scale;
137-
138-
this.height = Math.floor(this._system.y + this._system.height) * scale;
139-
this.width = (this._system.x + this._system.width + this.pagePadding![2]) * scale;
136+
this.height = Math.floor(this._system.y + this._system.height);
137+
this.width = (this._system.x + this._system.width + this.pagePadding![2]);
140138
currentBarIndex = 0;
141139

142140
let x = 0;
@@ -146,10 +144,10 @@ export class HorizontalScreenLayout extends ScoreLayout {
146144
const e = new RenderFinishedEventArgs();
147145
e.x = x;
148146
e.y = 0;
149-
e.totalWidth = this.width / scale;
150-
e.totalHeight = this.height / scale;
147+
e.totalWidth = this.width;
148+
e.totalHeight = this.height;
151149
e.width = partial.width;
152-
e.height = this.height / scale;
150+
e.height = this.height;
153151
e.firstMasterBarIndex = partial.masterBars[0].index;
154152
e.lastMasterBarIndex = partial.masterBars[partial.masterBars.length - 1].index;
155153

@@ -188,6 +186,8 @@ export class HorizontalScreenLayout extends ScoreLayout {
188186
this.height = this.layoutAndRenderAnnotation(this.height);
189187

190188
this.height += this.pagePadding![3];
189+
190+
this.height *= this.renderer.settings.display.scale;
191191
}
192192

193193
private _finalizeStaffSystem() {

0 commit comments

Comments
 (0)