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
|
* @param {Object} parameters
|
||||||
*/
|
*/
|
||||||
update(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.viewport = parameters.viewport;
|
||||||
this.setDimensions();
|
this.setDimensions();
|
||||||
this.updateMode();
|
this.updateMode();
|
||||||
|
@ -941,11 +941,7 @@ class AnnotationEditorUIManager {
|
|||||||
* Delete the current editor or all.
|
* Delete the current editor or all.
|
||||||
*/
|
*/
|
||||||
delete() {
|
delete() {
|
||||||
if (this.#activeEditor) {
|
this.commitOrRemove();
|
||||||
// An editor is being edited so just commit it.
|
|
||||||
this.#activeEditor.commitOrRemove();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.hasSelection) {
|
if (!this.hasSelection) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -965,6 +961,11 @@ class AnnotationEditorUIManager {
|
|||||||
this.addCommands({ cmd, undo, mustExec: true });
|
this.addCommands({ cmd, undo, mustExec: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
commitOrRemove() {
|
||||||
|
// An editor is being edited so just commit it.
|
||||||
|
this.#activeEditor?.commitOrRemove();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select the editors.
|
* Select the editors.
|
||||||
* @param {Array<AnnotationEditor>} editors
|
* @param {Array<AnnotationEditor>} editors
|
||||||
|
Loading…
Reference in New Issue
Block a user