@hprint/plugins 0.0.1-alpha.3 → 0.0.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/index.js +17 -17
  2. package/dist/index.mjs +1282 -1277
  3. package/dist/src/plugins/CreateElementPlugin.d.ts +4 -0
  4. package/dist/src/plugins/CreateElementPlugin.d.ts.map +1 -1
  5. package/dist/src/utils/ruler/ruler.d.ts +1 -0
  6. package/dist/src/utils/ruler/ruler.d.ts.map +1 -1
  7. package/package.json +3 -3
  8. package/src/assets/style/resizePlugin.css +27 -27
  9. package/src/objects/Arrow.js +47 -47
  10. package/src/objects/ThinTailArrow.js +50 -50
  11. package/src/plugins/AlignGuidLinePlugin.ts +1152 -1152
  12. package/src/plugins/ControlsPlugin.ts +251 -251
  13. package/src/plugins/ControlsRotatePlugin.ts +111 -111
  14. package/src/plugins/CopyPlugin.ts +255 -255
  15. package/src/plugins/CreateElementPlugin.ts +23 -2
  16. package/src/plugins/DeleteHotKeyPlugin.ts +57 -57
  17. package/src/plugins/DrawLinePlugin.ts +162 -162
  18. package/src/plugins/DrawPolygonPlugin.ts +205 -205
  19. package/src/plugins/DringPlugin.ts +125 -125
  20. package/src/plugins/FlipPlugin.ts +59 -59
  21. package/src/plugins/FontPlugin.ts +165 -165
  22. package/src/plugins/FreeDrawPlugin.ts +49 -49
  23. package/src/plugins/GroupAlignPlugin.ts +365 -365
  24. package/src/plugins/GroupPlugin.ts +82 -82
  25. package/src/plugins/GroupTextEditorPlugin.ts +198 -198
  26. package/src/plugins/HistoryPlugin.ts +181 -181
  27. package/src/plugins/ImageStroke.ts +121 -121
  28. package/src/plugins/LayerPlugin.ts +108 -108
  29. package/src/plugins/LockPlugin.ts +242 -242
  30. package/src/plugins/MaskPlugin.ts +155 -155
  31. package/src/plugins/MaterialPlugin.ts +224 -224
  32. package/src/plugins/MiddleMousePlugin.ts +45 -45
  33. package/src/plugins/MoveHotKeyPlugin.ts +46 -46
  34. package/src/plugins/PathTextPlugin.ts +89 -89
  35. package/src/plugins/PolygonModifyPlugin.ts +224 -224
  36. package/src/plugins/PrintPlugin.ts +81 -81
  37. package/src/plugins/PsdPlugin.ts +52 -52
  38. package/src/plugins/ResizePlugin.ts +278 -278
  39. package/src/plugins/RulerPlugin.ts +78 -78
  40. package/src/plugins/SimpleClipImagePlugin.ts +244 -244
  41. package/src/plugins/UnitPlugin.ts +326 -326
  42. package/src/plugins/WaterMarkPlugin.ts +257 -257
  43. package/src/types/eventType.ts +11 -11
  44. package/src/utils/psd.js +432 -432
  45. package/src/utils/ruler/guideline.ts +145 -145
  46. package/src/utils/ruler/index.ts +91 -91
  47. package/src/utils/ruler/ruler.ts +936 -924
  48. package/src/utils/ruler/utils.ts +162 -162
  49. package/tsconfig.json +10 -10
  50. package/vite.config.ts +29 -29
@@ -1,251 +1,251 @@
1
- import { fabric } from '@hprint/core';
2
- import verticalImg from '../assets/middlecontrol.svg?url';
3
- // import verticalImg from './middlecontrol.svg';
4
- import horizontalImg from '../assets/middlecontrolhoz.svg?url';
5
- import edgeImg from '../assets/edgecontrol.svg?url';
6
- import rotateImg from '../assets/rotateicon.svg?url';
7
- import type { IEditor, IPluginTempl } from '@hprint/core';
8
-
9
- /**
10
- * 实际场景: 在进行某个对象缩放的时候,由于fabricjs默认精度使用的是toFixed(2)。
11
- * 此处为了缩放的精度更准确一些,因此将NUM_FRACTION_DIGITS默认值改为4,即toFixed(4).
12
- */
13
- fabric.Object.NUM_FRACTION_DIGITS = 4;
14
-
15
- function drawImg(
16
- ctx: CanvasRenderingContext2D,
17
- left: number,
18
- top: number,
19
- img: HTMLImageElement,
20
- wSize: number,
21
- hSize: number,
22
- angle: number | undefined
23
- ) {
24
- if (angle === undefined) return;
25
- ctx.save();
26
- ctx.translate(left, top);
27
- ctx.rotate(fabric.util.degreesToRadians(angle));
28
- ctx.drawImage(img, -wSize / 2, -hSize / 2, wSize, hSize);
29
- ctx.restore();
30
- }
31
-
32
- // 中间横杠
33
- function intervalControl() {
34
- const verticalImgIcon = document.createElement('img');
35
- verticalImgIcon.src = verticalImg;
36
-
37
- const horizontalImgIcon = document.createElement('img');
38
- horizontalImgIcon.src = horizontalImg;
39
-
40
- function renderIcon(
41
- ctx: CanvasRenderingContext2D,
42
- left: number,
43
- top: number,
44
- styleOverride: any,
45
- fabricObject: fabric.Object
46
- ) {
47
- drawImg(ctx, left, top, verticalImgIcon, 20, 25, fabricObject.angle);
48
- }
49
-
50
- function renderIconHoz(
51
- ctx: CanvasRenderingContext2D,
52
- left: number,
53
- top: number,
54
- styleOverride: any,
55
- fabricObject: fabric.Object
56
- ) {
57
- drawImg(ctx, left, top, horizontalImgIcon, 25, 20, fabricObject.angle);
58
- }
59
- // 中间横杠
60
- fabric.Object.prototype.controls.ml = new fabric.Control({
61
- x: -0.5,
62
- y: 0,
63
- offsetX: -1,
64
- cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
65
- actionHandler: fabric.controlsUtils.scalingXOrSkewingY,
66
- getActionName: fabric.controlsUtils.scaleOrSkewActionName,
67
- render: renderIcon,
68
- });
69
-
70
- fabric.Object.prototype.controls.mr = new fabric.Control({
71
- x: 0.5,
72
- y: 0,
73
- offsetX: 1,
74
- cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
75
- actionHandler: fabric.controlsUtils.scalingXOrSkewingY,
76
- getActionName: fabric.controlsUtils.scaleOrSkewActionName,
77
- render: renderIcon,
78
- });
79
-
80
- fabric.Object.prototype.controls.mb = new fabric.Control({
81
- x: 0,
82
- y: 0.5,
83
- offsetY: 1,
84
- cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
85
- actionHandler: fabric.controlsUtils.scalingYOrSkewingX,
86
- getActionName: fabric.controlsUtils.scaleOrSkewActionName,
87
- render: renderIconHoz,
88
- });
89
-
90
- fabric.Object.prototype.controls.mt = new fabric.Control({
91
- x: 0,
92
- y: -0.5,
93
- offsetY: -1,
94
- cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
95
- actionHandler: fabric.controlsUtils.scalingYOrSkewingX,
96
- getActionName: fabric.controlsUtils.scaleOrSkewActionName,
97
- render: renderIconHoz,
98
- });
99
- }
100
-
101
- // 顶点
102
- function peakControl() {
103
- const img = document.createElement('img');
104
- img.src = edgeImg;
105
-
106
- function renderIconEdge(
107
- ctx: CanvasRenderingContext2D,
108
- left: number,
109
- top: number,
110
- styleOverride: any,
111
- fabricObject: fabric.Object
112
- ) {
113
- drawImg(ctx, left, top, img, 25, 25, fabricObject.angle);
114
- }
115
- // 四角图标
116
- fabric.Object.prototype.controls.tl = new fabric.Control({
117
- x: -0.5,
118
- y: -0.5,
119
- cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
120
- actionHandler: fabric.controlsUtils.scalingEqually,
121
- render: renderIconEdge,
122
- });
123
- fabric.Object.prototype.controls.bl = new fabric.Control({
124
- x: -0.5,
125
- y: 0.5,
126
- cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
127
- actionHandler: fabric.controlsUtils.scalingEqually,
128
- render: renderIconEdge,
129
- });
130
- fabric.Object.prototype.controls.tr = new fabric.Control({
131
- x: 0.5,
132
- y: -0.5,
133
- cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
134
- actionHandler: fabric.controlsUtils.scalingEqually,
135
- render: renderIconEdge,
136
- });
137
- fabric.Object.prototype.controls.br = new fabric.Control({
138
- x: 0.5,
139
- y: 0.5,
140
- cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
141
- actionHandler: fabric.controlsUtils.scalingEqually,
142
- render: renderIconEdge,
143
- });
144
- }
145
-
146
- // 删除
147
- /*function deleteControl(canvas: fabric.Canvas) {
148
- const deleteIcon =
149
- "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E";
150
- const delImg = document.createElement('img');
151
- delImg.src = deleteIcon;
152
-
153
- function renderDelIcon(
154
- ctx: CanvasRenderingContext2D,
155
- left: number,
156
- top: number,
157
- styleOverride: any,
158
- fabricObject: fabric.Object
159
- ) {
160
- drawImg(ctx, left, top, delImg, 24, 24, fabricObject.angle);
161
- }
162
-
163
- // 删除选中元素
164
- function deleteObject(mouseEvent: MouseEvent, target: fabric.Transform) {
165
- if (target.action === 'rotate') return true;
166
- const activeObject = canvas.getActiveObjects();
167
- if (activeObject) {
168
- activeObject.map((item) => canvas.remove(item));
169
- canvas.requestRenderAll();
170
- canvas.discardActiveObject();
171
- }
172
- return true;
173
- }
174
-
175
- // 删除图标
176
- fabric.Object.prototype.controls.deleteControl = new fabric.Control({
177
- x: 0.5,
178
- y: -0.5,
179
- offsetY: -16,
180
- offsetX: 16,
181
- cursorStyle: 'pointer',
182
- mouseUpHandler: deleteObject,
183
- render: renderDelIcon,
184
- // cornerSize: 24,
185
- });
186
- }*/
187
-
188
- // 旋转
189
- function rotationControl() {
190
- const img = document.createElement('img');
191
- img.src = rotateImg;
192
- function renderIconRotate(
193
- ctx: CanvasRenderingContext2D,
194
- left: number,
195
- top: number,
196
- styleOverride: any,
197
- fabricObject: fabric.Object
198
- ) {
199
- drawImg(ctx, left, top, img, 40, 40, fabricObject.angle);
200
- }
201
- // 旋转图标
202
- fabric.Object.prototype.controls.mtr = new fabric.Control({
203
- x: 0,
204
- y: 0.5,
205
- cursorStyleHandler: fabric.controlsUtils.rotationStyleHandler,
206
- actionHandler: fabric.controlsUtils.rotationWithSnapping,
207
- offsetY: 30,
208
- // withConnecton: false,
209
- actionName: 'rotate',
210
- render: renderIconRotate,
211
- });
212
- }
213
-
214
- class ControlsPlugin implements IPluginTempl {
215
- static pluginName = 'ControlsPlugin';
216
- constructor(
217
- public canvas: fabric.Canvas,
218
- public editor: IEditor
219
- ) {
220
- this.init();
221
- }
222
- init() {
223
- // 删除图标
224
- // deleteControl(this.canvas);
225
- // 顶点图标
226
- peakControl();
227
- // 中间横杠图标
228
- intervalControl();
229
- // 旋转图标
230
- rotationControl();
231
-
232
- // 选中样式
233
- fabric.Object.prototype.set({
234
- transparentCorners: false,
235
- borderColor: '#51B9F9',
236
- cornerColor: '#FFF',
237
- borderScaleFactor: 2.5,
238
- cornerStyle: 'circle',
239
- cornerStrokeColor: '#0E98FC',
240
- borderOpacityWhenMoving: 1,
241
- });
242
- // textbox保持一致
243
- // fabric.Textbox.prototype.controls = fabric.Object.prototype.controls;
244
- }
245
-
246
- destroy() {
247
- console.log('pluginDestroy');
248
- }
249
- }
250
-
251
- export default ControlsPlugin;
1
+ import { fabric } from '@hprint/core';
2
+ import verticalImg from '../assets/middlecontrol.svg?url';
3
+ // import verticalImg from './middlecontrol.svg';
4
+ import horizontalImg from '../assets/middlecontrolhoz.svg?url';
5
+ import edgeImg from '../assets/edgecontrol.svg?url';
6
+ import rotateImg from '../assets/rotateicon.svg?url';
7
+ import type { IEditor, IPluginTempl } from '@hprint/core';
8
+
9
+ /**
10
+ * 实际场景: 在进行某个对象缩放的时候,由于fabricjs默认精度使用的是toFixed(2)。
11
+ * 此处为了缩放的精度更准确一些,因此将NUM_FRACTION_DIGITS默认值改为4,即toFixed(4).
12
+ */
13
+ fabric.Object.NUM_FRACTION_DIGITS = 4;
14
+
15
+ function drawImg(
16
+ ctx: CanvasRenderingContext2D,
17
+ left: number,
18
+ top: number,
19
+ img: HTMLImageElement,
20
+ wSize: number,
21
+ hSize: number,
22
+ angle: number | undefined
23
+ ) {
24
+ if (angle === undefined) return;
25
+ ctx.save();
26
+ ctx.translate(left, top);
27
+ ctx.rotate(fabric.util.degreesToRadians(angle));
28
+ ctx.drawImage(img, -wSize / 2, -hSize / 2, wSize, hSize);
29
+ ctx.restore();
30
+ }
31
+
32
+ // 中间横杠
33
+ function intervalControl() {
34
+ const verticalImgIcon = document.createElement('img');
35
+ verticalImgIcon.src = verticalImg;
36
+
37
+ const horizontalImgIcon = document.createElement('img');
38
+ horizontalImgIcon.src = horizontalImg;
39
+
40
+ function renderIcon(
41
+ ctx: CanvasRenderingContext2D,
42
+ left: number,
43
+ top: number,
44
+ styleOverride: any,
45
+ fabricObject: fabric.Object
46
+ ) {
47
+ drawImg(ctx, left, top, verticalImgIcon, 20, 25, fabricObject.angle);
48
+ }
49
+
50
+ function renderIconHoz(
51
+ ctx: CanvasRenderingContext2D,
52
+ left: number,
53
+ top: number,
54
+ styleOverride: any,
55
+ fabricObject: fabric.Object
56
+ ) {
57
+ drawImg(ctx, left, top, horizontalImgIcon, 25, 20, fabricObject.angle);
58
+ }
59
+ // 中间横杠
60
+ fabric.Object.prototype.controls.ml = new fabric.Control({
61
+ x: -0.5,
62
+ y: 0,
63
+ offsetX: -1,
64
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
65
+ actionHandler: fabric.controlsUtils.scalingXOrSkewingY,
66
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
67
+ render: renderIcon,
68
+ });
69
+
70
+ fabric.Object.prototype.controls.mr = new fabric.Control({
71
+ x: 0.5,
72
+ y: 0,
73
+ offsetX: 1,
74
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
75
+ actionHandler: fabric.controlsUtils.scalingXOrSkewingY,
76
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
77
+ render: renderIcon,
78
+ });
79
+
80
+ fabric.Object.prototype.controls.mb = new fabric.Control({
81
+ x: 0,
82
+ y: 0.5,
83
+ offsetY: 1,
84
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
85
+ actionHandler: fabric.controlsUtils.scalingYOrSkewingX,
86
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
87
+ render: renderIconHoz,
88
+ });
89
+
90
+ fabric.Object.prototype.controls.mt = new fabric.Control({
91
+ x: 0,
92
+ y: -0.5,
93
+ offsetY: -1,
94
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
95
+ actionHandler: fabric.controlsUtils.scalingYOrSkewingX,
96
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
97
+ render: renderIconHoz,
98
+ });
99
+ }
100
+
101
+ // 顶点
102
+ function peakControl() {
103
+ const img = document.createElement('img');
104
+ img.src = edgeImg;
105
+
106
+ function renderIconEdge(
107
+ ctx: CanvasRenderingContext2D,
108
+ left: number,
109
+ top: number,
110
+ styleOverride: any,
111
+ fabricObject: fabric.Object
112
+ ) {
113
+ drawImg(ctx, left, top, img, 25, 25, fabricObject.angle);
114
+ }
115
+ // 四角图标
116
+ fabric.Object.prototype.controls.tl = new fabric.Control({
117
+ x: -0.5,
118
+ y: -0.5,
119
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
120
+ actionHandler: fabric.controlsUtils.scalingEqually,
121
+ render: renderIconEdge,
122
+ });
123
+ fabric.Object.prototype.controls.bl = new fabric.Control({
124
+ x: -0.5,
125
+ y: 0.5,
126
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
127
+ actionHandler: fabric.controlsUtils.scalingEqually,
128
+ render: renderIconEdge,
129
+ });
130
+ fabric.Object.prototype.controls.tr = new fabric.Control({
131
+ x: 0.5,
132
+ y: -0.5,
133
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
134
+ actionHandler: fabric.controlsUtils.scalingEqually,
135
+ render: renderIconEdge,
136
+ });
137
+ fabric.Object.prototype.controls.br = new fabric.Control({
138
+ x: 0.5,
139
+ y: 0.5,
140
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
141
+ actionHandler: fabric.controlsUtils.scalingEqually,
142
+ render: renderIconEdge,
143
+ });
144
+ }
145
+
146
+ // 删除
147
+ /*function deleteControl(canvas: fabric.Canvas) {
148
+ const deleteIcon =
149
+ "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E";
150
+ const delImg = document.createElement('img');
151
+ delImg.src = deleteIcon;
152
+
153
+ function renderDelIcon(
154
+ ctx: CanvasRenderingContext2D,
155
+ left: number,
156
+ top: number,
157
+ styleOverride: any,
158
+ fabricObject: fabric.Object
159
+ ) {
160
+ drawImg(ctx, left, top, delImg, 24, 24, fabricObject.angle);
161
+ }
162
+
163
+ // 删除选中元素
164
+ function deleteObject(mouseEvent: MouseEvent, target: fabric.Transform) {
165
+ if (target.action === 'rotate') return true;
166
+ const activeObject = canvas.getActiveObjects();
167
+ if (activeObject) {
168
+ activeObject.map((item) => canvas.remove(item));
169
+ canvas.requestRenderAll();
170
+ canvas.discardActiveObject();
171
+ }
172
+ return true;
173
+ }
174
+
175
+ // 删除图标
176
+ fabric.Object.prototype.controls.deleteControl = new fabric.Control({
177
+ x: 0.5,
178
+ y: -0.5,
179
+ offsetY: -16,
180
+ offsetX: 16,
181
+ cursorStyle: 'pointer',
182
+ mouseUpHandler: deleteObject,
183
+ render: renderDelIcon,
184
+ // cornerSize: 24,
185
+ });
186
+ }*/
187
+
188
+ // 旋转
189
+ function rotationControl() {
190
+ const img = document.createElement('img');
191
+ img.src = rotateImg;
192
+ function renderIconRotate(
193
+ ctx: CanvasRenderingContext2D,
194
+ left: number,
195
+ top: number,
196
+ styleOverride: any,
197
+ fabricObject: fabric.Object
198
+ ) {
199
+ drawImg(ctx, left, top, img, 40, 40, fabricObject.angle);
200
+ }
201
+ // 旋转图标
202
+ fabric.Object.prototype.controls.mtr = new fabric.Control({
203
+ x: 0,
204
+ y: 0.5,
205
+ cursorStyleHandler: fabric.controlsUtils.rotationStyleHandler,
206
+ actionHandler: fabric.controlsUtils.rotationWithSnapping,
207
+ offsetY: 30,
208
+ // withConnecton: false,
209
+ actionName: 'rotate',
210
+ render: renderIconRotate,
211
+ });
212
+ }
213
+
214
+ class ControlsPlugin implements IPluginTempl {
215
+ static pluginName = 'ControlsPlugin';
216
+ constructor(
217
+ public canvas: fabric.Canvas,
218
+ public editor: IEditor
219
+ ) {
220
+ this.init();
221
+ }
222
+ init() {
223
+ // 删除图标
224
+ // deleteControl(this.canvas);
225
+ // 顶点图标
226
+ peakControl();
227
+ // 中间横杠图标
228
+ intervalControl();
229
+ // 旋转图标
230
+ rotationControl();
231
+
232
+ // 选中样式
233
+ fabric.Object.prototype.set({
234
+ transparentCorners: false,
235
+ borderColor: '#51B9F9',
236
+ cornerColor: '#FFF',
237
+ borderScaleFactor: 2.5,
238
+ cornerStyle: 'circle',
239
+ cornerStrokeColor: '#0E98FC',
240
+ borderOpacityWhenMoving: 1,
241
+ });
242
+ // textbox保持一致
243
+ // fabric.Textbox.prototype.controls = fabric.Object.prototype.controls;
244
+ }
245
+
246
+ destroy() {
247
+ console.log('pluginDestroy');
248
+ }
249
+ }
250
+
251
+ export default ControlsPlugin;