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

pull/48396/head
Nathan Marrs 3 years ago committed by GitHub
parent b990d3c9e3
commit 86971b1b30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      public/app/features/canvas/runtime/group.tsx
  2. 5
      public/app/features/canvas/runtime/scene.tsx

@ -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?

@ -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);
}

Loading…
Cancel
Save