@pooder/kit 6.2.1 → 6.3.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/.test-dist/src/extensions/dieline/renderBuilder.js +19 -2
- package/.test-dist/src/extensions/image/ImageTool.js +180 -467
- package/.test-dist/src/extensions/image/commands.js +60 -40
- package/.test-dist/src/extensions/image/imageOperations.js +75 -0
- package/.test-dist/src/extensions/image/index.js +1 -0
- package/.test-dist/src/extensions/image/model.js +4 -0
- package/.test-dist/src/extensions/image/sessionOverlay.js +148 -0
- package/.test-dist/src/extensions/ruler/RulerTool.js +1 -1
- package/.test-dist/tests/run.js +39 -5
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +252 -168
- package/dist/index.d.ts +252 -168
- package/dist/index.js +806 -846
- package/dist/index.mjs +802 -845
- package/package.json +1 -1
- package/src/extensions/dieline/renderBuilder.ts +26 -4
- package/src/extensions/image/ImageTool.ts +229 -557
- package/src/extensions/image/commands.ts +69 -48
- package/src/extensions/image/imageOperations.ts +135 -0
- package/src/extensions/image/index.ts +1 -0
- package/src/extensions/image/model.ts +13 -1
- package/src/extensions/image/sessionOverlay.ts +206 -0
- package/tests/run.ts +49 -8
|
@@ -62,6 +62,13 @@ function buildDielineRenderBundle(options) {
|
|
|
62
62
|
canvasWidth,
|
|
63
63
|
canvasHeight,
|
|
64
64
|
};
|
|
65
|
+
const cutFrameRect = {
|
|
66
|
+
left: cx - cutW / 2,
|
|
67
|
+
top: cy - cutH / 2,
|
|
68
|
+
width: cutW,
|
|
69
|
+
height: cutH,
|
|
70
|
+
space: "screen",
|
|
71
|
+
};
|
|
65
72
|
const specs = [];
|
|
66
73
|
if (insideColor &&
|
|
67
74
|
insideColor !== "transparent" &&
|
|
@@ -186,9 +193,13 @@ function buildDielineRenderBundle(options) {
|
|
|
186
193
|
width: cutW,
|
|
187
194
|
height: cutH,
|
|
188
195
|
radius: cutR,
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
// Build the clip path in the cut frame's local coordinates so Fabric
|
|
197
|
+
// does not have to infer placement from the standalone path bounds.
|
|
198
|
+
x: cutW / 2,
|
|
199
|
+
y: cutH / 2,
|
|
191
200
|
features: cutFeatures,
|
|
201
|
+
canvasWidth: cutW,
|
|
202
|
+
canvasHeight: cutH,
|
|
192
203
|
});
|
|
193
204
|
if (!clipPathData) {
|
|
194
205
|
return { specs, effects: [] };
|
|
@@ -205,6 +216,12 @@ function buildDielineRenderBundle(options) {
|
|
|
205
216
|
id: ids.clipSource,
|
|
206
217
|
type: "path",
|
|
207
218
|
space: "screen",
|
|
219
|
+
layout: {
|
|
220
|
+
reference: "custom",
|
|
221
|
+
referenceRect: cutFrameRect,
|
|
222
|
+
alignX: "start",
|
|
223
|
+
alignY: "start",
|
|
224
|
+
},
|
|
208
225
|
data: {
|
|
209
226
|
id: ids.clipSource,
|
|
210
227
|
type: "dieline-effect",
|