@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pooder/kit",
3
- "version": "6.2.1",
3
+ "version": "6.3.0",
4
4
  "description": "Standard plugins for Pooder editor",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,5 +1,9 @@
1
1
  import type { Pattern } from "fabric";
2
- import type { RenderEffectSpec, RenderObjectSpec, VisibilityExpr } from "../../services";
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 } = state;
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
- x: cx,
262
- y: cy,
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",