diff --git a/packages/core/plugin/WorkspacePlugin.ts b/packages/core/plugin/WorkspacePlugin.ts index 375132b8..8aa330c4 100644 --- a/packages/core/plugin/WorkspacePlugin.ts +++ b/packages/core/plugin/WorkspacePlugin.ts @@ -79,7 +79,9 @@ class WorkspacePlugin implements IPluginTempl { height, id: 'workspace', strokeWidth: 0, + erasable: false, }); + workspace.set('selectable', false); workspace.set('hasControls', false); workspace.hoverCursor = 'default'; diff --git a/src/components/erase.vue b/src/components/erase.vue index c6ab2e50..e10011a4 100644 --- a/src/components/erase.vue +++ b/src/components/erase.vue @@ -41,7 +41,7 @@ const doErase = () => { if (isErase.value) { canvas.isDrawingMode = true; canvas.freeDrawingBrush = new fabric.EraserBrush(canvas); - canvas.freeDrawingBrush.width = 15; // optional + canvas.freeDrawingBrush.width = 15; } else { canvas.isDrawingMode = false; } diff --git a/src/components/imgStroke.vue b/src/components/imgStroke.vue index 3e67f857..0ec26602 100644 --- a/src/components/imgStroke.vue +++ b/src/components/imgStroke.vue @@ -119,7 +119,6 @@ const onSliderChange = (val: number) => { }; const onColorChange = (val: string) => { - console.log('onColorChnage', val); strokeColor.value = val; updateStroke(); }; diff --git a/typings/extends.d.ts b/typings/extends.d.ts index 9cc23b7a..43371952 100644 --- a/typings/extends.d.ts +++ b/typings/extends.d.ts @@ -101,4 +101,8 @@ declare namespace fabric { export class EraserBrush { constructor(canvas: Canvas); } + + export interface IRectOptions { + [key: string]: unknown; + } }