Skip to content

Commit

Permalink
fix(右键菜单): 右键菜单显示快捷建错误问题修复 (#535)
Browse files Browse the repository at this point in the history
* fix(右键菜单): 右键菜单显示快捷建错误问题修复

* fix(翻转插件): 右键菜单,x和y轴翻转的国际化显示错误
  • Loading branch information
bigFace2019 authored Nov 4, 2024
1 parent 1a08d57 commit 6dca813
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/core/plugin/CenterAlignPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: 秦少卫
* @Date: 2023-06-15 22:49:42
* @LastEditors: 秦少卫
* @LastEditTime: 2024-07-09 14:12:41
* @LastEditors: bigFace2019 [email protected]
* @LastEditTime: 2024-11-03 20:39:43
* @Description: 居中对齐插件
*/

Expand Down Expand Up @@ -59,7 +59,7 @@ class CenterAlignPlugin implements IPluginTempl {
return [
{
text: '水平垂直居中',
hotkey: 'Ctrl+V',
hotkey: '',
disabled: false,
onclick: () => this.position('center'),
},
Expand Down
9 changes: 6 additions & 3 deletions packages/core/plugin/DeleteHotKeyPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: 秦少卫
* @Date: 2023-06-20 12:57:35
* @LastEditors: 秦少卫
* @LastEditTime: 2024-04-10 17:33:02
* @LastEditors: bigFace2019 [email protected]
* @LastEditTime: 2024-11-03 20:38:33
* @Description: 删除快捷键
*/

Expand Down Expand Up @@ -42,7 +42,10 @@ class DeleteHotKeyPlugin implements IPluginTempl {
contextMenu() {
const activeObject = this.canvas.getActiveObject();
if (activeObject) {
return [null, { text: '删除', hotkey: 'Ctrl+V', disabled: false, onclick: () => this.del() }];
return [
null,
{ text: '删除', hotkey: 'Backspace', disabled: false, onclick: () => this.del() },
];
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/core/plugin/FlipPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fabric } from 'fabric';
import { SelectMode } from '../eventType';
import type { IEditor, IPluginTempl } from '@kuaitu/core';
import i18n from "@/language";

type IPlugin = Pick<FlipPlugin, 'flip'>;

Expand All @@ -9,7 +10,6 @@ declare module '@kuaitu/core' {
interface IEditor extends IPlugin {}
}

const t = (key: string) => key;
// import event from '@/utils/event/notifier';

export default class FlipPlugin implements IPluginTempl {
Expand All @@ -34,12 +34,12 @@ export default class FlipPlugin implements IPluginTempl {
hotkey: '❯',
subitems: [
{
text: t('flip.x'),
text: i18n.global.t('flip.x'),
hotkey: '|',
onclick: () => this.flip('X'),
},
{
text: t('flip.y'),
text: i18n.global.t('flip.y'),
hotkey: '-',
onclick: () => this.flip('Y'),
},
Expand Down
6 changes: 5 additions & 1 deletion src/language/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"width": "宽度",
"height": "高度"
},
"flip": {
"x": "水平翻转",
"y": "垂直翻转"
},
"attrSeting": {
"group": "成组",
"unGroup": "拆分组",
Expand Down Expand Up @@ -254,4 +258,4 @@
},
"mine": "我的",
"batch": "批量"
}
}

0 comments on commit 6dca813

Please sign in to comment.