@pooder/kit 1.0.0 → 3.0.0
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.
- package/CHANGELOG.md +22 -0
- package/dist/index.d.mts +250 -115
- package/dist/index.d.ts +250 -115
- package/dist/index.js +2177 -831
- package/dist/index.mjs +2182 -826
- package/package.json +3 -2
- package/src/CanvasService.ts +65 -0
- package/src/background.ts +230 -172
- package/src/coordinate.ts +49 -0
- package/src/dieline.ts +780 -421
- package/src/film.ts +194 -156
- package/src/geometry.ts +464 -244
- package/src/hole.ts +629 -413
- package/src/image.ts +504 -147
- package/src/index.ts +9 -7
- package/src/mirror.ts +128 -0
- package/src/ruler.ts +325 -239
- package/src/tracer.ts +372 -0
- package/src/white-ink.ts +373 -301
- package/tsconfig.json +13 -13
package/src/white-ink.ts
CHANGED
|
@@ -1,301 +1,373 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
1
|
+
import {
|
|
2
|
+
Extension,
|
|
3
|
+
ExtensionContext,
|
|
4
|
+
ContributionPointIds,
|
|
5
|
+
CommandContribution,
|
|
6
|
+
ConfigurationContribution,
|
|
7
|
+
} from "@pooder/core";
|
|
8
|
+
import { FabricImage as Image, filters } from "fabric";
|
|
9
|
+
import CanvasService from "./CanvasService";
|
|
10
|
+
|
|
11
|
+
export class WhiteInkTool implements Extension {
|
|
12
|
+
id = "pooder.kit.white-ink";
|
|
13
|
+
|
|
14
|
+
public metadata = {
|
|
15
|
+
name: "WhiteInkTool",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
private customMask: string = "";
|
|
19
|
+
private opacity: number = 1;
|
|
20
|
+
private enableClip: boolean = false;
|
|
21
|
+
|
|
22
|
+
private canvasService?: CanvasService;
|
|
23
|
+
private syncHandler: ((e: any) => void) | undefined;
|
|
24
|
+
private _loadingUrl: string | null = null;
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
options?: Partial<{
|
|
28
|
+
customMask: string;
|
|
29
|
+
opacity: number;
|
|
30
|
+
enableClip: boolean;
|
|
31
|
+
}>,
|
|
32
|
+
) {
|
|
33
|
+
if (options) {
|
|
34
|
+
Object.assign(this, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
activate(context: ExtensionContext) {
|
|
39
|
+
this.canvasService = context.services.get<CanvasService>("CanvasService");
|
|
40
|
+
if (!this.canvasService) {
|
|
41
|
+
console.warn("CanvasService not found for WhiteInkTool");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const configService = context.services.get<any>("ConfigurationService");
|
|
46
|
+
if (configService) {
|
|
47
|
+
// Load initial config
|
|
48
|
+
this.customMask = configService.get(
|
|
49
|
+
"whiteInk.customMask",
|
|
50
|
+
this.customMask,
|
|
51
|
+
);
|
|
52
|
+
this.opacity = configService.get("whiteInk.opacity", this.opacity);
|
|
53
|
+
this.enableClip = configService.get(
|
|
54
|
+
"whiteInk.enableClip",
|
|
55
|
+
this.enableClip,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Listen for changes
|
|
59
|
+
configService.onAnyChange((e: { key: string; value: any }) => {
|
|
60
|
+
if (e.key.startsWith("whiteInk.")) {
|
|
61
|
+
const prop = e.key.split(".")[1];
|
|
62
|
+
console.log(
|
|
63
|
+
`[WhiteInkTool] Config change detected: ${e.key} -> ${e.value}`,
|
|
64
|
+
);
|
|
65
|
+
if (prop && prop in this) {
|
|
66
|
+
(this as any)[prop] = e.value;
|
|
67
|
+
this.updateWhiteInk();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
this.setup();
|
|
74
|
+
this.updateWhiteInk();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
deactivate(context: ExtensionContext) {
|
|
78
|
+
this.teardown();
|
|
79
|
+
this.canvasService = undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
contribute() {
|
|
83
|
+
return {
|
|
84
|
+
[ContributionPointIds.CONFIGURATIONS]: [
|
|
85
|
+
{
|
|
86
|
+
id: "whiteInk.customMask",
|
|
87
|
+
type: "string",
|
|
88
|
+
label: "Custom Mask URL",
|
|
89
|
+
default: "",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "whiteInk.opacity",
|
|
93
|
+
type: "number",
|
|
94
|
+
label: "Opacity",
|
|
95
|
+
min: 0,
|
|
96
|
+
max: 1,
|
|
97
|
+
step: 0.01,
|
|
98
|
+
default: 1,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "whiteInk.enableClip",
|
|
102
|
+
type: "boolean",
|
|
103
|
+
label: "Enable Clip",
|
|
104
|
+
default: false,
|
|
105
|
+
},
|
|
106
|
+
] as ConfigurationContribution[],
|
|
107
|
+
[ContributionPointIds.COMMANDS]: [
|
|
108
|
+
{
|
|
109
|
+
command: "setWhiteInkImage",
|
|
110
|
+
title: "Set White Ink Image",
|
|
111
|
+
handler: (
|
|
112
|
+
customMask: string,
|
|
113
|
+
opacity: number,
|
|
114
|
+
enableClip: boolean = true,
|
|
115
|
+
) => {
|
|
116
|
+
if (
|
|
117
|
+
this.customMask === customMask &&
|
|
118
|
+
this.opacity === opacity &&
|
|
119
|
+
this.enableClip === enableClip
|
|
120
|
+
)
|
|
121
|
+
return true;
|
|
122
|
+
|
|
123
|
+
this.customMask = customMask;
|
|
124
|
+
this.opacity = opacity;
|
|
125
|
+
this.enableClip = enableClip;
|
|
126
|
+
|
|
127
|
+
this.updateWhiteInk();
|
|
128
|
+
return true;
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
] as CommandContribution[],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private setup() {
|
|
136
|
+
if (!this.canvasService) return;
|
|
137
|
+
const canvas = this.canvasService.canvas;
|
|
138
|
+
|
|
139
|
+
let userLayer = this.canvasService.getLayer("user");
|
|
140
|
+
if (!userLayer) {
|
|
141
|
+
userLayer = this.canvasService.createLayer("user", {
|
|
142
|
+
width: canvas.width,
|
|
143
|
+
height: canvas.height,
|
|
144
|
+
left: 0,
|
|
145
|
+
top: 0,
|
|
146
|
+
originX: "left",
|
|
147
|
+
originY: "top",
|
|
148
|
+
selectable: false,
|
|
149
|
+
evented: true,
|
|
150
|
+
subTargetCheck: true,
|
|
151
|
+
interactive: true,
|
|
152
|
+
});
|
|
153
|
+
canvas.add(userLayer);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (!this.syncHandler) {
|
|
157
|
+
this.syncHandler = (e: any) => {
|
|
158
|
+
const target = e.target;
|
|
159
|
+
if (target && target.data?.id === "user-image") {
|
|
160
|
+
this.syncWithUserImage();
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
canvas.on("object:moving", this.syncHandler);
|
|
165
|
+
canvas.on("object:scaling", this.syncHandler);
|
|
166
|
+
canvas.on("object:rotating", this.syncHandler);
|
|
167
|
+
canvas.on("object:modified", this.syncHandler);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
private teardown() {
|
|
172
|
+
if (!this.canvasService) return;
|
|
173
|
+
const canvas = this.canvasService.canvas;
|
|
174
|
+
|
|
175
|
+
if (this.syncHandler) {
|
|
176
|
+
canvas.off("object:moving", this.syncHandler);
|
|
177
|
+
canvas.off("object:scaling", this.syncHandler);
|
|
178
|
+
canvas.off("object:rotating", this.syncHandler);
|
|
179
|
+
canvas.off("object:modified", this.syncHandler);
|
|
180
|
+
this.syncHandler = undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const layer = this.canvasService.getLayer("user");
|
|
184
|
+
if (layer) {
|
|
185
|
+
const whiteInk = this.canvasService.getObject("white-ink", "user");
|
|
186
|
+
if (whiteInk) {
|
|
187
|
+
layer.remove(whiteInk);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const userImage = this.canvasService.getObject("user-image", "user") as any;
|
|
192
|
+
if (userImage && userImage.clipPath) {
|
|
193
|
+
userImage.set({ clipPath: undefined });
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
this.canvasService.requestRenderAll();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
private updateWhiteInk() {
|
|
200
|
+
if (!this.canvasService) return;
|
|
201
|
+
const { customMask, opacity, enableClip } = this;
|
|
202
|
+
|
|
203
|
+
const layer = this.canvasService.getLayer("user");
|
|
204
|
+
if (!layer) {
|
|
205
|
+
console.warn("[WhiteInkTool] User layer not found");
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const whiteInk = this.canvasService.getObject("white-ink", "user") as any;
|
|
210
|
+
const userImage = this.canvasService.getObject("user-image", "user") as any;
|
|
211
|
+
|
|
212
|
+
if (!customMask) {
|
|
213
|
+
if (whiteInk) {
|
|
214
|
+
layer.remove(whiteInk);
|
|
215
|
+
}
|
|
216
|
+
if (userImage && userImage.clipPath) {
|
|
217
|
+
userImage.set({ clipPath: undefined });
|
|
218
|
+
}
|
|
219
|
+
layer.dirty = true;
|
|
220
|
+
this.canvasService.requestRenderAll();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Check if we need to load/reload white ink backing
|
|
225
|
+
if (whiteInk) {
|
|
226
|
+
const currentSrc = whiteInk.getSrc?.() || whiteInk._element?.src;
|
|
227
|
+
if (currentSrc !== customMask) {
|
|
228
|
+
this.loadWhiteInk(layer, customMask, opacity, enableClip, whiteInk);
|
|
229
|
+
} else {
|
|
230
|
+
if (whiteInk.opacity !== opacity) {
|
|
231
|
+
whiteInk.set({ opacity });
|
|
232
|
+
layer.dirty = true;
|
|
233
|
+
this.canvasService.requestRenderAll();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
this.loadWhiteInk(layer, customMask, opacity, enableClip);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Handle Clip Path Toggle
|
|
241
|
+
if (userImage) {
|
|
242
|
+
if (enableClip) {
|
|
243
|
+
if (!userImage.clipPath) {
|
|
244
|
+
this.applyClipPath(customMask);
|
|
245
|
+
}
|
|
246
|
+
} else {
|
|
247
|
+
if (userImage.clipPath) {
|
|
248
|
+
userImage.set({ clipPath: undefined });
|
|
249
|
+
layer.dirty = true;
|
|
250
|
+
this.canvasService.requestRenderAll();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
private loadWhiteInk(
|
|
257
|
+
layer: any,
|
|
258
|
+
url: string,
|
|
259
|
+
opacity: number,
|
|
260
|
+
enableClip: boolean,
|
|
261
|
+
oldImage?: any,
|
|
262
|
+
) {
|
|
263
|
+
if (!this.canvasService) return;
|
|
264
|
+
|
|
265
|
+
if (this._loadingUrl === url) return;
|
|
266
|
+
this._loadingUrl = url;
|
|
267
|
+
|
|
268
|
+
Image.fromURL(url, { crossOrigin: "anonymous" })
|
|
269
|
+
.then((image) => {
|
|
270
|
+
if (this._loadingUrl !== url) return;
|
|
271
|
+
this._loadingUrl = null;
|
|
272
|
+
|
|
273
|
+
if (oldImage) {
|
|
274
|
+
layer.remove(oldImage);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
image.filters?.push(
|
|
278
|
+
new filters.BlendColor({
|
|
279
|
+
color: "#FFFFFF",
|
|
280
|
+
mode: "add",
|
|
281
|
+
}),
|
|
282
|
+
);
|
|
283
|
+
image.applyFilters();
|
|
284
|
+
|
|
285
|
+
image.set({
|
|
286
|
+
opacity,
|
|
287
|
+
selectable: false,
|
|
288
|
+
evented: false,
|
|
289
|
+
data: {
|
|
290
|
+
id: "white-ink",
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
// Add to layer
|
|
295
|
+
layer.add(image);
|
|
296
|
+
|
|
297
|
+
// Ensure white-ink is behind user-image
|
|
298
|
+
const userImage = this.canvasService!.getObject("user-image", "user");
|
|
299
|
+
if (userImage) {
|
|
300
|
+
// Re-adding moves it to the top of the stack
|
|
301
|
+
layer.remove(userImage);
|
|
302
|
+
layer.add(userImage);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Apply clip path to user-image if enabled
|
|
306
|
+
if (enableClip) {
|
|
307
|
+
this.applyClipPath(url);
|
|
308
|
+
} else if (userImage) {
|
|
309
|
+
userImage.set({ clipPath: undefined });
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Sync position immediately
|
|
313
|
+
this.syncWithUserImage();
|
|
314
|
+
|
|
315
|
+
layer.dirty = true;
|
|
316
|
+
this.canvasService!.requestRenderAll();
|
|
317
|
+
})
|
|
318
|
+
.catch((err) => {
|
|
319
|
+
console.error("Failed to load white ink mask", url, err);
|
|
320
|
+
this._loadingUrl = null;
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
private applyClipPath(url: string) {
|
|
325
|
+
if (!this.canvasService) return;
|
|
326
|
+
const userImage = this.canvasService.getObject("user-image", "user") as any;
|
|
327
|
+
if (!userImage) return;
|
|
328
|
+
|
|
329
|
+
Image.fromURL(url, { crossOrigin: "anonymous" })
|
|
330
|
+
.then((maskImage) => {
|
|
331
|
+
// Configure clipPath
|
|
332
|
+
maskImage.set({
|
|
333
|
+
originX: "center",
|
|
334
|
+
originY: "center",
|
|
335
|
+
left: 0,
|
|
336
|
+
top: 0,
|
|
337
|
+
// Scale to fit userImage if dimensions differ
|
|
338
|
+
scaleX: userImage.width / maskImage.width,
|
|
339
|
+
scaleY: userImage.height / maskImage.height,
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
userImage.set({ clipPath: maskImage });
|
|
343
|
+
const layer = this.canvasService!.getLayer("user");
|
|
344
|
+
if (layer) layer.dirty = true;
|
|
345
|
+
this.canvasService!.requestRenderAll();
|
|
346
|
+
})
|
|
347
|
+
.catch((err) => {
|
|
348
|
+
console.error("Failed to load clip path", url, err);
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
private syncWithUserImage() {
|
|
353
|
+
if (!this.canvasService) return;
|
|
354
|
+
const userImage = this.canvasService.getObject("user-image", "user");
|
|
355
|
+
const whiteInk = this.canvasService.getObject("white-ink", "user");
|
|
356
|
+
|
|
357
|
+
if (userImage && whiteInk) {
|
|
358
|
+
whiteInk.set({
|
|
359
|
+
left: userImage.left,
|
|
360
|
+
top: userImage.top,
|
|
361
|
+
scaleX: userImage.scaleX,
|
|
362
|
+
scaleY: userImage.scaleY,
|
|
363
|
+
angle: userImage.angle,
|
|
364
|
+
skewX: userImage.skewX,
|
|
365
|
+
skewY: userImage.skewY,
|
|
366
|
+
flipX: userImage.flipX,
|
|
367
|
+
flipY: userImage.flipY,
|
|
368
|
+
originX: userImage.originX,
|
|
369
|
+
originY: userImage.originY,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|