Skip to content

Commit

Permalink
Develop (#80)
Browse files Browse the repository at this point in the history
* update: 默认README为英文

* update: 更新README的codesandbox地址

* update: 新增codesandbox地址

* update: 新增宣传图

* fix: 修复移动画布后解除组合导致画布偏移问题

* fix: 解决ts引入的时的类型错误

* update:  更新依赖包文件

* update: 更新版本号

* update: 添加贡献者名单

* update: 发布新版本

* update: 更新版本号

* update: 更新包管理

* update: 删除无用依赖,并更新eslint

* update: 升级版本号

* update: 用workspace代替线上版本号

* update: 更新属性工具属性入参

* update: 更新本地依赖包

* update: 更新setTool方法

* update: 更新tool的config类型

* refactor: diamond -> regularPolygon

* update: setTool可以设置null也可设置相同tool

* update: 同一tool导出内容

* update: 更新版本号

* update: 使用空间别名饮用依赖包

* update: 更新tools的config配置

* update: 工具ImageTool导出ImageConfig

* update: 升级版本到1.0.0

* update: 删除无用的公共依赖

* update: 更新vitest版本号

* update: 增加本地启动逻辑

* fix: 修复文本在编辑态删除

* update: 更新版本号

* update: 更新本地依赖

* update: 更新部分依赖包版本

* update: 更新网址国际化

* refactor: 重构代码结构

* update: 补充history:installed事件的触发

* update: 升级版本号

* update: 更新版本号

* update: 更新版本号1.0.1->1.0.2

* update: 删除无用的事件注册

* update: 更新导入文件后图层顺序问题

* update: 删除插件定义中的 resetLayer

* update: 画布拖拽时鼠标移动事件无法响应

---------

Co-authored-by: Yan Heng <yanheng@siactpower.com>
  • Loading branch information
JessYan0913 and Yan Heng authored Mar 21, 2024
1 parent 3982a01 commit 45560c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
11 changes: 1 addition & 10 deletions packages/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export class App extends BaseService<EventArgs> {
const layer = Konva.Node.create(data, 'layer');
this.mainLayer = layer;
this.stage.add(this.mainLayer);
this.resetPluginsLayer([...this.installedPlugins.keys()]);
this.mainLayer.moveToBottom();
this.render();
return this;
}
Expand Down Expand Up @@ -523,15 +523,6 @@ export class App extends BaseService<EventArgs> {
return this;
}

public resetPluginsLayer(plugins: string | string[]): this {
if (!Array.isArray(plugins)) {
plugins = [plugins];
}
const aboutToChangePlugins = this.getPlugins(plugins);
aboutToChangePlugins?.forEach((plugin) => plugin?.resetLayer?.());
return this;
}

public destroy(): void {
this.off('canvas:resized', this.updateBackground);
this.off('canvas:drag:move', this.updateBackground);
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/services/mouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export class Mouse extends Service {
};

private onMouseMove = (event: KonvaMouseEvent): void => {
if (this.app.stage.draggable()) {
return;
}
this.app.emit('mouse:move', { event });
};

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export interface Plugin {
enable?(): void;
disable?(): void;
isEnabled?(): boolean;
resetLayer?(): void;
}

export interface ToolEvent {
Expand Down

0 comments on commit 45560c9

Please sign in to comment.