From ae8c1206c1472bb3f3769ab4b082de81e9ae82b0 Mon Sep 17 00:00:00 2001 From: dx123456 Date: Fri, 19 Jul 2024 22:23:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E6=97=B6=EF=BC=8C=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=B2=A1=E6=9C=89=E6=B8=85=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/plugin/HistoryPlugin.ts | 4 ++-- src/components/save.vue | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/plugin/HistoryPlugin.ts b/packages/core/plugin/HistoryPlugin.ts index 818c305e..2993abcb 100644 --- a/packages/core/plugin/HistoryPlugin.ts +++ b/packages/core/plugin/HistoryPlugin.ts @@ -21,8 +21,8 @@ type extendCanvas = { class HistoryPlugin implements IPluginTempl { static pluginName = 'HistoryPlugin'; - static apis = ['undo', 'redo']; - static events = ['historyUpdate']; + static apis = ['undo', 'redo', 'historyUpdate']; + static events = []; hotkeys: string[] = ['ctrl+z', 'ctrl+shift+z', '⌘+z', '⌘+shift+z']; constructor(public canvas: fabric.Canvas & extendCanvas, public editor: IEditor) { fabric.Canvas.prototype._historyNext = () => { diff --git a/src/components/save.vue b/src/components/save.vue index 8f04b424..74d3e014 100644 --- a/src/components/save.vue +++ b/src/components/save.vue @@ -99,6 +99,8 @@ const saveWith = debounce(function (type) { */ const clear = () => { canvasEditor.clear(); + canvasEditor.canvas.clearHistory(false); + canvasEditor.historyUpdate(); }; const beforeClear = () => { From 3730b60aa2b1b8d4afd7f34bbd559806e338803a Mon Sep 17 00:00:00 2001 From: June <1601745371@qq.com> Date: Tue, 23 Jul 2024 09:36:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(plugin):=20=E4=BF=AE=E5=A4=8D=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E6=8F=92=E4=BB=B6black=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=85=B6=E4=BB=96ui=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/plugin/QrCodePlugin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/plugin/QrCodePlugin.ts b/packages/core/plugin/QrCodePlugin.ts index bce2f97b..98b2a1ea 100644 --- a/packages/core/plugin/QrCodePlugin.ts +++ b/packages/core/plugin/QrCodePlugin.ts @@ -69,11 +69,11 @@ class QrCodePlugin implements IPluginTempl { width: 300, margin: 10, errorCorrectionLevel: 'M', - dotsColor: 'black', + dotsColor: '#000000', dotsType: 'rounded', - cornersSquareColor: 'black', + cornersSquareColor: '#000000', cornersSquareType: 'square', - cornersDotColor: 'black', + cornersDotColor: '#000000', cornersDotType: 'square', background: '#ffffff', }; From fb0ae88f7882b1c2dc006df1f3e6d7a265459e7d Mon Sep 17 00:00:00 2001 From: Alice Peng <1399789151@qq.com> Date: Thu, 25 Jul 2024 17:42:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(hook):=20=E5=88=A0=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/select.ts | 19 +++++++++---------- src/hooks/useSelectListen.ts | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/hooks/select.ts b/src/hooks/select.ts index 2b0c0717..c088b59a 100644 --- a/src/hooks/select.ts +++ b/src/hooks/select.ts @@ -6,18 +6,17 @@ * @LastEditors: 秦少卫 * @LastEditTime: 2024-06-10 20:11:48 */ -import Editor, { EventType } from '@kuaitu/core'; +import Editor from '@kuaitu/core'; import { useI18n } from 'vue-i18n'; -const { SelectMode } = EventType; - -interface Selector { - mSelectMode: (typeof SelectMode)[keyof typeof SelectMode]; - mSelectOneType: string | undefined; - mSelectId: string | undefined; - mSelectIds: (string | undefined)[]; - mSelectActive: unknown[]; -} +import { type Selector } from './useSelectListen'; +// interface Selector { +// mSelectMode: (typeof SelectMode)[keyof typeof SelectMode]; +// mSelectOneType: string | undefined; +// mSelectId: string | undefined; +// mSelectIds: (string | undefined)[]; +// mSelectActive: unknown[]; +// } export default function useSelect() { const fabric = inject('fabric'); diff --git a/src/hooks/useSelectListen.ts b/src/hooks/useSelectListen.ts index f2007fb7..190d6eaa 100644 --- a/src/hooks/useSelectListen.ts +++ b/src/hooks/useSelectListen.ts @@ -11,7 +11,7 @@ import { get } from 'lodash-es'; const { SelectEvent, SelectMode } = EventType; -interface Selector { +export interface Selector { mSelectMode: (typeof SelectMode)[keyof typeof SelectMode]; mSelectOneType: string | undefined; mSelectId: string | undefined; @@ -30,7 +30,7 @@ export default function useSelectListen(canvasEditor: Editor) { const selectOne = (e: [fabric.Object]) => { state.mSelectMode = SelectMode.ONE; - state.mSelectActive = e[0]; + state.mSelectActive = e; if (e[0] && get(e[0], 'clip')) { selectCancel(); // state.mSelectId = get(e[0], 'targetId');