Skip to content

Commit

Permalink
Update transposition pitches not only on score change (CoderLine#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielku15 authored and ChiHoc committed Nov 7, 2022
1 parent e934eef commit 8f2dab4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/AlphaTabApiBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export class AlphaTabApiBase<TSettings> {
* Applies any changes that were done to the settings object and informs the {@link renderer} about any new values to consider.
*/
public updateSettings(): void {
const score = this.score;
if (score) {
ModelUtils.applyPitchOffsets(this.settings, score);
}
this.renderer.updateSettings(this.settings);
// enable/disable player if needed
if (this.settings.player.enablePlayer) {
Expand Down Expand Up @@ -272,8 +276,8 @@ export class AlphaTabApiBase<TSettings> {
}

private internalRenderTracks(score: Score, tracks: Track[]): void {
ModelUtils.applyPitchOffsets(this.settings, score);
if (score !== this.score) {
ModelUtils.applyPitchOffsets(this.settings, score);
this.score = score;
this.tracks = tracks;
this._trackIndexes = [];
Expand Down Expand Up @@ -1017,7 +1021,7 @@ export class AlphaTabApiBase<TSettings> {
if (
nextBeatBoundings &&
nextBeatBoundings.barBounds.masterBarBounds.staveGroupBounds ===
barBoundings.staveGroupBounds
barBoundings.staveGroupBounds
) {
nextBeatX = nextBeatBoundings.visualBounds.x;
}
Expand Down

0 comments on commit 8f2dab4

Please sign in to comment.