Fix layer action / constraint change adhering to inline editing state (#48390)

This commit is contained in:
Nathan Marrs 2022-04-27 21:09:27 -07:00 committed by GitHub
parent b990d3c9e3
commit 86971b1b30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -77,7 +77,7 @@ export class GroupState extends ElementState {
reinitializeMoveable() {
// Need to first clear current selection and then re-init moveable with slight delay
this.scene.clearCurrentSelection();
setTimeout(() => this.scene.initMoveable(true), 100);
setTimeout(() => this.scene.initMoveable(true, this.scene.isEditingEnabled), 100);
}
// ??? or should this be on the element directly?

View File

@ -52,6 +52,7 @@ export class Scene {
moveable?: Moveable;
div?: HTMLDivElement;
currentLayer?: GroupState;
isEditingEnabled?: boolean;
constructor(cfg: CanvasGroupOptions, enableEditing: boolean, public onSave: (cfg: CanvasGroupOptions) => void) {
this.root = this.load(cfg, enableEditing);
@ -86,6 +87,8 @@ export class Scene {
this.save // callback when changes are made
);
this.isEditingEnabled = enableEditing;
setTimeout(() => {
if (this.div) {
// If editing is enabled, clear selecto instance
@ -165,7 +168,7 @@ export class Scene {
if (updateMoveable) {
setTimeout(() => {
if (this.div) {
this.initMoveable(true);
this.initMoveable(true, this.isEditingEnabled);
}
}, 100);
}