Skip to content

更新属性 moveable 不更新 #666

@PittyXu

Description

@PittyXu

Describe the bug
图片组件更新图片时,由于图片大小改变,渲染内容会改变大小,但是 moveable 没有自动随图片大小更新。

当前通过以下方式进行解决(但是时延的大小不好控制),希望能够自动更新或通过 editorService.select(data.model.id) 这种更上层方式更新。

onChange: async (_mForm: FormState | undefined, value: string, data: OnChangeHandlerData) => {
  setTimeout(() => { // 修正图片大小改变选择框不变问题
    const stage = editorService.get('stage');
    if (!stage) return;
    const id = data.model.id;

    const el = stage.renderer?.getTargetElement(id) || null;
    stage.actionManager?.select(el);
  }, 100);
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions