leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

在编辑器插件的onUpdate中清除编辑器控制点,然后移动、缩放画布后1秒左右,控制点又显示了

Open coderhyh opened this issue 3 months ago • 2 comments

leafer版本:1.9.10 降到1.9.7不会有bug,其他版本未测试

复现步骤:

  1. 选中线元素
  2. 移动或者缩放画布之后一秒左右
  3. 控制点就又显示出来了 按理不应该显示的

最小实现:

import { Line, LineEditTool, App, registerEditTool } from 'leafer-editor';

@registerEditTool()
export class CustomEditTool extends LineEditTool {
  get tag() { return 'CustomEditTool'; }

  constructor(editor) {
    super(editor);
  }

  onUpdate() {
    const { rotatePoints, resizeLines, resizePoints } = this.editBox;
    for (let i = 0; i < 8; i++) {
      if (i < 4)
        resizeLines[i].visible = false;
      resizePoints[i].visible = false;
      rotatePoints[i].visible = false;
    }
  }
}


Line.setEditOuter('CustomEditTool')


const app = new App({ view: window, editor: {} })

app.tree.add(
    Line.one({ editable: true, stroke: '#FEB027', strokeWidth: 3 }, 100, 100),
)

coderhyh avatar Oct 06 '25 11:10 coderhyh

收到,谢谢反馈~

leaferjs avatar Oct 09 '25 00:10 leaferjs

已修复,等待新版本发布

leaferjs avatar Oct 09 '25 03:10 leaferjs