@pixldocs/canvas-renderer 0.5.356 → 0.5.358

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.
@@ -11200,7 +11200,18 @@ function applyWarpAwareSelectionBorders(selection) {
11200
11200
  invSelection,
11201
11201
  worldMatrices[index]
11202
11202
  );
11203
- fabric.util.applyTransformToObject(k, localMatrix);
11203
+ const savedLayout = k.layoutManager;
11204
+ try {
11205
+ if (savedLayout) k.layoutManager = void 0;
11206
+ fabric.util.applyTransformToObject(k, localMatrix);
11207
+ const decomposed = fabric.util.qrDecompose(
11208
+ localMatrix
11209
+ );
11210
+ const expectedCenter = new fabric.Point(decomposed.translateX, decomposed.translateY);
11211
+ k.setPositionByOrigin(expectedCenter, "center", "center");
11212
+ } finally {
11213
+ if (savedLayout) k.layoutManager = savedLayout;
11214
+ }
11204
11215
  k.setCoords();
11205
11216
  k.dirty = true;
11206
11217
  });
@@ -11216,20 +11227,7 @@ function applyWarpAwareSelectionBorders(selection) {
11216
11227
  selection.dirty = true;
11217
11228
  selection.__pixldocsAlignedAngle = targetAngle;
11218
11229
  try {
11219
- const kidSummary = kids.map((c) => ({
11220
- id: c.id ?? c.__pixldocsId,
11221
- type: c.type,
11222
- left: c.left,
11223
- top: c.top,
11224
- angle: c.angle,
11225
- scaleX: c.scaleX,
11226
- scaleY: c.scaleY,
11227
- originX: c.originX,
11228
- originY: c.originY,
11229
- width: c.width,
11230
- height: c.height
11231
- }));
11232
- console.info("[Pixldocs][rot-group-image-drift] aligned-on-select", {
11230
+ const payload = {
11233
11231
  targetAngle,
11234
11232
  selection: {
11235
11233
  left: selection.left,
@@ -11242,8 +11240,21 @@ function applyWarpAwareSelectionBorders(selection) {
11242
11240
  originX: selection.originX,
11243
11241
  originY: selection.originY
11244
11242
  },
11245
- kids: kidSummary
11246
- });
11243
+ kids: kids.map((c) => ({
11244
+ id: c.id ?? c.__pixldocsId,
11245
+ type: c.type,
11246
+ left: c.left,
11247
+ top: c.top,
11248
+ angle: c.angle,
11249
+ scaleX: c.scaleX,
11250
+ scaleY: c.scaleY,
11251
+ originX: c.originX,
11252
+ originY: c.originY,
11253
+ width: c.width,
11254
+ height: c.height
11255
+ }))
11256
+ };
11257
+ console.info("[Pixldocs][rot-group-image-drift] aligned-on-select " + JSON.stringify(payload));
11247
11258
  } catch {
11248
11259
  }
11249
11260
  }
@@ -14262,24 +14273,9 @@ const PageCanvas = forwardRef(
14262
14273
  try {
14263
14274
  const t = tr;
14264
14275
  if (t) {
14265
- const childSummary = (t._objects ?? []).map((c) => ({
14266
- id: getObjectId(c),
14267
- type: c.type,
14268
- left: c.left,
14269
- top: c.top,
14270
- angle: c.angle,
14271
- scaleX: c.scaleX,
14272
- scaleY: c.scaleY,
14273
- originX: c.originX,
14274
- originY: c.originY,
14275
- width: c.width,
14276
- height: c.height
14277
- }));
14278
- console.info("[Pixldocs][rot-group-image-drift] rotating", {
14276
+ const payload = {
14279
14277
  targetType: t.type,
14280
14278
  isAS: t instanceof fabric.ActiveSelection,
14281
- isGroup: t instanceof fabric.Group,
14282
- targetId: getObjectId(t),
14283
14279
  left: t.left,
14284
14280
  top: t.top,
14285
14281
  angle: t.angle,
@@ -14290,8 +14286,21 @@ const PageCanvas = forwardRef(
14290
14286
  originX: t.originX,
14291
14287
  originY: t.originY,
14292
14288
  childCount: (t._objects ?? []).length,
14293
- children: childSummary
14294
- });
14289
+ children: (t._objects ?? []).map((c) => ({
14290
+ id: getObjectId(c),
14291
+ type: c.type,
14292
+ left: c.left,
14293
+ top: c.top,
14294
+ angle: c.angle,
14295
+ scaleX: c.scaleX,
14296
+ scaleY: c.scaleY,
14297
+ originX: c.originX,
14298
+ originY: c.originY,
14299
+ width: c.width,
14300
+ height: c.height
14301
+ }))
14302
+ };
14303
+ console.info("[Pixldocs][rot-group-image-drift] rotating " + JSON.stringify(payload));
14295
14304
  }
14296
14305
  } catch {
14297
14306
  }
@@ -14330,24 +14339,9 @@ const PageCanvas = forwardRef(
14330
14339
  try {
14331
14340
  const t = e.target;
14332
14341
  if (t && (t.angle ?? 0) !== 0) {
14333
- const childSummary = (t._objects ?? []).map((c) => ({
14334
- id: getObjectId(c),
14335
- type: c.type,
14336
- left: c.left,
14337
- top: c.top,
14338
- angle: c.angle,
14339
- scaleX: c.scaleX,
14340
- scaleY: c.scaleY,
14341
- originX: c.originX,
14342
- originY: c.originY,
14343
- width: c.width,
14344
- height: c.height
14345
- }));
14346
- console.info("[Pixldocs][rot-group-image-drift] moving", {
14342
+ const payload = {
14347
14343
  targetType: t.type,
14348
14344
  isAS: t instanceof fabric.ActiveSelection,
14349
- isGroup: t instanceof fabric.Group,
14350
- targetId: getObjectId(t),
14351
14345
  left: t.left,
14352
14346
  top: t.top,
14353
14347
  angle: t.angle,
@@ -14358,8 +14352,21 @@ const PageCanvas = forwardRef(
14358
14352
  originX: t.originX,
14359
14353
  originY: t.originY,
14360
14354
  childCount: (t._objects ?? []).length,
14361
- children: childSummary
14362
- });
14355
+ children: (t._objects ?? []).map((c) => ({
14356
+ id: getObjectId(c),
14357
+ type: c.type,
14358
+ left: c.left,
14359
+ top: c.top,
14360
+ angle: c.angle,
14361
+ scaleX: c.scaleX,
14362
+ scaleY: c.scaleY,
14363
+ originX: c.originX,
14364
+ originY: c.originY,
14365
+ width: c.width,
14366
+ height: c.height
14367
+ }))
14368
+ };
14369
+ console.info("[Pixldocs][rot-group-image-drift] moving " + JSON.stringify(payload));
14363
14370
  }
14364
14371
  } catch {
14365
14372
  }
@@ -24467,9 +24474,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24467
24474
  }
24468
24475
  return svgString;
24469
24476
  }
24470
- const resolvedPackageVersion = "0.5.356";
24477
+ const resolvedPackageVersion = "0.5.358";
24471
24478
  const PACKAGE_VERSION = resolvedPackageVersion;
24472
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.356";
24479
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.358";
24473
24480
  const roundParityValue = (value) => {
24474
24481
  if (typeof value !== "number") return value;
24475
24482
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25283,7 +25290,7 @@ class PixldocsRenderer {
25283
25290
  await this.waitForCanvasScene(container, cloned, i);
25284
25291
  }
25285
25292
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25286
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Dg5IQ77x.js");
25293
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Bk_ZPaK4.js");
25287
25294
  const prepared = preparePagesForExport(
25288
25295
  cloned.pages,
25289
25296
  canvasWidth,
@@ -27603,7 +27610,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27603
27610
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27604
27611
  sanitizeSvgTreeForPdf(svgToDraw);
27605
27612
  try {
27606
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Dg5IQ77x.js");
27613
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Bk_ZPaK4.js");
27607
27614
  try {
27608
27615
  await logTextMeasurementDiagnostic(svgToDraw);
27609
27616
  } catch {
@@ -28003,4 +28010,4 @@ export {
28003
28010
  buildTeaserBlurFlatKeys as y,
28004
28011
  collectFontDescriptorsFromConfig as z
28005
28012
  };
28006
- //# sourceMappingURL=index-SmBKCsve.js.map
28013
+ //# sourceMappingURL=index-D14RzE7l.js.map