@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
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Pattern } from "fabric";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
RenderEffectSpec,
|
|
4
|
+
RenderObjectSpec,
|
|
5
|
+
VisibilityExpr,
|
|
6
|
+
} from "../../services";
|
|
3
7
|
import type { SceneLayoutSnapshot } from "../../shared/scene/sceneLayoutModel";
|
|
4
8
|
import { generateBleedZonePath, generateDielinePath } from "../geometry";
|
|
5
9
|
import {
|
|
@@ -60,7 +64,8 @@ export function buildDielineRenderBundle(
|
|
|
60
64
|
clipTargetPassIds = [IMAGE_OBJECT_LAYER_ID],
|
|
61
65
|
clipVisibility,
|
|
62
66
|
} = options;
|
|
63
|
-
const { shape, shapeStyle, radius, mainLine, offsetLine, insideColor } =
|
|
67
|
+
const { shape, shapeStyle, radius, mainLine, offsetLine, insideColor } =
|
|
68
|
+
state;
|
|
64
69
|
|
|
65
70
|
const scale = sceneLayout.scale;
|
|
66
71
|
const cx = sceneLayout.trimRect.centerX;
|
|
@@ -118,6 +123,13 @@ export function buildDielineRenderBundle(
|
|
|
118
123
|
canvasWidth,
|
|
119
124
|
canvasHeight,
|
|
120
125
|
};
|
|
126
|
+
const cutFrameRect = {
|
|
127
|
+
left: cx - cutW / 2,
|
|
128
|
+
top: cy - cutH / 2,
|
|
129
|
+
width: cutW,
|
|
130
|
+
height: cutH,
|
|
131
|
+
space: "screen" as const,
|
|
132
|
+
};
|
|
121
133
|
|
|
122
134
|
const specs: RenderObjectSpec[] = [];
|
|
123
135
|
|
|
@@ -258,9 +270,13 @@ export function buildDielineRenderBundle(
|
|
|
258
270
|
width: cutW,
|
|
259
271
|
height: cutH,
|
|
260
272
|
radius: cutR,
|
|
261
|
-
|
|
262
|
-
|
|
273
|
+
// Build the clip path in the cut frame's local coordinates so Fabric
|
|
274
|
+
// does not have to infer placement from the standalone path bounds.
|
|
275
|
+
x: cutW / 2,
|
|
276
|
+
y: cutH / 2,
|
|
263
277
|
features: cutFeatures,
|
|
278
|
+
canvasWidth: cutW,
|
|
279
|
+
canvasHeight: cutH,
|
|
264
280
|
});
|
|
265
281
|
|
|
266
282
|
if (!clipPathData) {
|
|
@@ -279,6 +295,12 @@ export function buildDielineRenderBundle(
|
|
|
279
295
|
id: ids.clipSource,
|
|
280
296
|
type: "path",
|
|
281
297
|
space: "screen",
|
|
298
|
+
layout: {
|
|
299
|
+
reference: "custom",
|
|
300
|
+
referenceRect: cutFrameRect,
|
|
301
|
+
alignX: "start",
|
|
302
|
+
alignY: "start",
|
|
303
|
+
},
|
|
282
304
|
data: {
|
|
283
305
|
id: ids.clipSource,
|
|
284
306
|
type: "dieline-effect",
|