diff --git a/public/index.html b/public/index.html index 6f52be6..f449c2f 100644 --- a/public/index.html +++ b/public/index.html @@ -39,8 +39,8 @@ <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% } %> diff --git a/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/setSize.vue b/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/setSize.vue index 24cc581..40265f9 100644 --- a/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/setSize.vue +++ b/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/setSize.vue @@ -38,8 +38,8 @@ export default { inject: ['canvas', 'fabric'], data() { return { - width: 360 * 1.5, - height: 400 * 1.5, + width: 360 * 2, + height: 400 * 2, presetSize: [{ label: '红书竖版', width: 900, diff --git a/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/tools.vue b/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/tools.vue index ac3e9cc..e3bd76e 100644 --- a/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/tools.vue +++ b/src/page-subspecialty/views/modules/imgEditorFabric/img-editor/tools.vue @@ -122,6 +122,7 @@ export default { }, methods: { addText() { + this.closeLineMode() const text = new this.fabric.IText('万事大吉', { ...defaultPosition, fontSize: 40, id: uuid() @@ -130,6 +131,7 @@ export default { this.canvas.c.setActiveObject(text) }, addImg(e) { + this.closeLineMode() const imgEl = e.target.cloneNode(true) const imgInstance = new this.fabric.Image(imgEl, { ...defaultPosition, @@ -140,6 +142,7 @@ export default { this.canvas.c.renderAll() }, addTextBox() { + this.closeLineMode() const text = new this.fabric.Textbox('诸事顺遂', { ...defaultPosition, splitByGrapheme: true, width: 300, @@ -149,6 +152,7 @@ export default { this.canvas.c.setActiveObject(text) }, addTriangle() { + this.closeLineMode() const triangle = new this.fabric.Triangle({ top: 100, left: 100, @@ -160,6 +164,7 @@ export default { this.canvas.c.setActiveObject(triangle) }, addCircle() { + this.closeLineMode() const circle = new this.fabric.Circle({ ...defaultPosition, radius: 50, @@ -171,6 +176,7 @@ export default { this.canvas.c.setActiveObject(circle) }, addRect() { + this.closeLineMode() const circle = new this.fabric.Rect({ ...defaultPosition, fill: '#F57274', @@ -182,6 +188,10 @@ export default { this.canvas.c.add(circle) this.canvas.c.setActiveObject(circle) }, + closeLineMode() { + this.drawHandler.setMode(false) + this.drawHandler.setArrow(false) + }, drawingLineModeSwitch(isArrow) { this.isArrow = isArrow this.isDrawingLineMode = !this.isDrawingLineMode diff --git a/src/page-subspecialty/views/modules/imgEditorFabric/index.vue b/src/page-subspecialty/views/modules/imgEditorFabric/index.vue index 8f472d1..e020fd4 100644 --- a/src/page-subspecialty/views/modules/imgEditorFabric/index.vue +++ b/src/page-subspecialty/views/modules/imgEditorFabric/index.vue @@ -11,30 +11,30 @@