Skip to content

Commit

Permalink
修复bug (#409)
Browse files Browse the repository at this point in the history
* feat: 新增矩形圆角属性功能

* fix: 删除没用的注释

* fix: 修复英文单词太长显示不下的bug

* fix: 修复绘制元素前三个切换要点两下的bug,修复点了前三个再点后三个前三个依旧存在的bug

* fix: 修复绘制字体线未被正确取消的bug

* Update en.json

---------

Co-authored-by: pengzhijian <13087545742>
Co-authored-by: wuchenguang1998 <[email protected]>
  • Loading branch information
pengzhijian and wuchenguang1998 authored Jun 4, 2024
1 parent fa157d4 commit 581abe6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 17 additions & 3 deletions src/components/tools.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ const drawPolygon = () => {
};
if (state.lineType !== LINE_TYPE.polygon) {
endConflictTools();
endDrawingLineMode();
state.lineType = LINE_TYPE.polygon;
state.isDrawingLineMode = true;
canvasEditor.beginDrawPolygon(onEnd);
Expand All @@ -385,6 +386,7 @@ const drawPathText = () => {
canvasEditor.endTextPathDraw();
} else {
endConflictTools();
endDrawingLineMode();
state.lineType = LINE_TYPE.pathText;
state.isDrawingLineMode = true;
canvasEditor.startTextPathDraw();
Expand All @@ -398,6 +400,7 @@ const freeDraw = () => {
state.isDrawingLineMode = false;
} else {
endConflictTools();
endDrawingLineMode();
state.lineType = LINE_TYPE.freeDraw;
state.isDrawingLineMode = true;
canvasEditor.startDraw({ width: 20 });
Expand All @@ -409,12 +412,23 @@ const endConflictTools = () => {
canvasEditor.endDraw();
canvasEditor.endTextPathDraw();
};
const endDrawingLineMode = () => {
state.isDrawingLineMode = false;
state.lineType = '';
canvasEditor.setMode(state.isDrawingLineMode);
canvasEditor.setLineType(state.lineType);
};
const drawingLineModeSwitch = (type) => {
if ([LINE_TYPE.polygon, LINE_TYPE.freeDraw, LINE_TYPE.freeDraw].includes(state.lineType)) {
if ([LINE_TYPE.polygon, LINE_TYPE.freeDraw, LINE_TYPE.pathText].includes(state.lineType)) {
endConflictTools();
}
state.lineType = type;
state.isDrawingLineMode = !state.isDrawingLineMode;
if (state.lineType === type) {
state.isDrawingLineMode = false;
state.lineType = '';
} else {
state.isDrawingLineMode = true;
state.lineType = type;
}
canvasEditor.setMode(state.isDrawingLineMode);
canvasEditor.setLineType(type);
// this.canvasEditor.setMode(this.isDrawingLineMode);
Expand Down
4 changes: 2 additions & 2 deletions src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
"blur": "Blur",
"offset_x": "X",
"offset_y": "Y",
"borderRadiusX": "Horizontal borderRadius",
"borderRadiusY": "Vertical borderRadius",
"borderRadiusX": "radiusX",
"borderRadiusY": "radiusY",
"rx_ry": "Rounded"
},
"setSizeTip": "Resize canvas",
Expand Down

0 comments on commit 581abe6

Please sign in to comment.