Skip to content

Commit

Permalink
fix(组内文字): 编辑其他属性后不生效
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaojob committed Jul 25, 2024
1 parent c098971 commit 86558e5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/core/plugin/GroupTextEditorPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
* @Author: 秦少卫
* @Date: 2023-06-22 16:11:40
* @LastEditors: 秦少卫
* @LastEditTime: 2024-04-10 17:33:22
* @LastEditTime: 2024-07-25 16:49:18
* @Description: 组内文字编辑
*/

import { fabric } from 'fabric';
import Editor from '../Editor';
import { isGroup } from '../utils/utils';
import { v4 as uuid } from 'uuid';
import { pick } from 'lodash-es';
type IEditor = Editor;

class GroupTextEditorPlugin implements IPluginTempl {
Expand Down Expand Up @@ -116,8 +117,18 @@ class GroupTextEditorPlugin implements IPluginTempl {
tempText.selectAll();

tempText.on('editing:exited', () => {
const attrs = tempText.toObject();

// 进入编辑模式时触发
textObject.set({
...pick(attrs, [
'fill',
'fontSize',
'fontStyle',
'fontFamily',
'lineHeight',
'backgroundColor',
]),
text: tempText.text,
visible: true,
});
Expand Down

0 comments on commit 86558e5

Please sign in to comment.