@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.
@@ -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
- x: cx,
190
- y: cy,
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",