Merge pull request #15583 from calixteman/15582
[Editor] Commit the current editor before setting the new viewport
This commit is contained in:
commit
9355b72931
@ -561,6 +561,11 @@ class AnnotationEditorLayer {
|
||||
* @param {Object} parameters
|
||||
*/
|
||||
update(parameters) {
|
||||
// Editors have their dimensions/positions in percent so to avoid any
|
||||
// issues (see #15582), we must commit the current one before changing
|
||||
// the viewport.
|
||||
this.#uiManager.commitOrRemove();
|
||||
|
||||
this.viewport = parameters.viewport;
|
||||
this.setDimensions();
|
||||
this.updateMode();
|
||||
|
@ -941,11 +941,7 @@ class AnnotationEditorUIManager {
|
||||
* Delete the current editor or all.
|
||||
*/
|
||||
delete() {
|
||||
if (this.#activeEditor) {
|
||||
// An editor is being edited so just commit it.
|
||||
this.#activeEditor.commitOrRemove();
|
||||
}
|
||||
|
||||
this.commitOrRemove();
|
||||
if (!this.hasSelection) {
|
||||
return;
|
||||
}
|
||||
@ -965,6 +961,11 @@ class AnnotationEditorUIManager {
|
||||
this.addCommands({ cmd, undo, mustExec: true });
|
||||
}
|
||||
|
||||
commitOrRemove() {
|
||||
// An editor is being edited so just commit it.
|
||||
this.#activeEditor?.commitOrRemove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the editors.
|
||||
* @param {Array<AnnotationEditor>} editors
|
||||
|
Loading…
Reference in New Issue
Block a user