diff --git a/src/render/sui/scoreView.ts b/src/render/sui/scoreView.ts index 9e1b4b5f..d009509a 100644 --- a/src/render/sui/scoreView.ts +++ b/src/render/sui/scoreView.ts @@ -441,6 +441,12 @@ export abstract class SuiScoreView { staff.setMappedStaffId(this.staffMap[staff.staffId]); }); } + resetPartView() { + if (this.staffMap.length === 1) { + const staff = this.storeScore.staves[this.staffMap[0]]; + this.exposePart(staff); + } + } /** * Exposes a part: hides non-part staves, shows part staves. * Note this will reset the view. After this operation, staff 0 will @@ -492,7 +498,6 @@ export abstract class SuiScoreView { } }); } - /** * Update the list of staves in the score that are displayed. */ diff --git a/src/render/sui/scoreViewOperations.ts b/src/render/sui/scoreViewOperations.ts index 666511e0..6e111370 100644 --- a/src/render/sui/scoreViewOperations.ts +++ b/src/render/sui/scoreViewOperations.ts @@ -84,10 +84,9 @@ export class SuiScoreViewOperations extends SuiScoreView { this.storeScore.updateTextGroup(altGroup, false); } else { const stave = this.storeScore.staves[this._getEquivalentStaff(0)]; - stave.partInfo.updateTextGroup(altGroup, false); + stave.partInfo.textGroups = this.score.textGroups; SmoUndoable.changeTextGroup(this.storeScore, this.storeUndo, altGroup, - UndoBuffer.bufferSubtypes.REMOVE); - + UndoBuffer.bufferSubtypes.REMOVE); } this.renderer.renderScoreModifiers(); return this.renderer.updatePromise() @@ -1608,6 +1607,8 @@ export class SuiScoreViewOperations extends SuiScoreView { } } if (resetView || restChange || stavesChange) { + SmoOperation.computeMultipartRest(this.score); + // this.resetPartView(); this.renderer.rerenderAll() } return this.renderer.updatePromise(); diff --git a/src/smo/data/scoreText.ts b/src/smo/data/scoreText.ts index 06f3299d..f1851072 100644 --- a/src/smo/data/scoreText.ts +++ b/src/smo/data/scoreText.ts @@ -130,7 +130,7 @@ export class SmoScoreText extends SmoScoreModifierBase { y: 15, width: 0, height: 0, - text: 'Smoosic', + text: 'Text', fontInfo: { size: 14, family: SmoScoreText.fontFamilies.serif, @@ -153,7 +153,7 @@ export class SmoScoreText extends SmoScoreModifierBase { y: number = 15; width: number = 0; height: number = 0; - text: string = 'Smoosic'; + text: string = 'Text'; fontInfo: FontInfo = { size: 14, family: SmoScoreText.fontFamilies.serif, diff --git a/src/ui/dialogs/partInfo.ts b/src/ui/dialogs/partInfo.ts index 1e72ef3d..bb43be6f 100644 --- a/src/ui/dialogs/partInfo.ts +++ b/src/ui/dialogs/partInfo.ts @@ -18,6 +18,7 @@ export class SuiPartInfoAdapter extends SuiComponentAdapter { backup: SmoPartInfo; selection: SmoSelection; changed: boolean = false; + expandedMultimeasure: boolean = false; currentView: ViewMapEntry[] = []; resetPart: boolean = false; constructor(view: SuiScoreViewOperations) { @@ -29,10 +30,17 @@ export class SuiPartInfoAdapter extends SuiComponentAdapter { this.backup = new SmoPartInfo(this.selection.staff.partInfo); } async update() { - this.changed = true; + this.changed = true; // Since update will change the displayed score, wait for any display change to complete first. await this.view.renderer.updatePromise(); await this.view.updatePartInfo(this.partInfo); + // If we are expanding rests, we need to reload the part after setting the + // part change. So we update the part display a second time with the new value. + if (this.resetPart) { + this.view.resetPartView(); + await this.view.updatePartInfo(this.partInfo); + this.resetPart = false; + } } writeLayoutValue(attr: GlobalLayoutAttributes, value: number) { // no change? @@ -54,7 +62,10 @@ export class SuiPartInfoAdapter extends SuiComponentAdapter { } set expandMultimeasureRest(value: boolean) { this.partInfo.expandMultimeasureRests = value; - this.resetPart = true; + // If expanding rests, we need to re-read the score, so end + if (value === true) { + this.resetPart = true; + } this.update(); } get noteSpacing() {