@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.
@@ -11218,7 +11218,18 @@ function applyWarpAwareSelectionBorders(selection) {
11218
11218
  invSelection,
11219
11219
  worldMatrices[index]
11220
11220
  );
11221
- fabric__namespace.util.applyTransformToObject(k, localMatrix);
11221
+ const savedLayout = k.layoutManager;
11222
+ try {
11223
+ if (savedLayout) k.layoutManager = void 0;
11224
+ fabric__namespace.util.applyTransformToObject(k, localMatrix);
11225
+ const decomposed = fabric__namespace.util.qrDecompose(
11226
+ localMatrix
11227
+ );
11228
+ const expectedCenter = new fabric__namespace.Point(decomposed.translateX, decomposed.translateY);
11229
+ k.setPositionByOrigin(expectedCenter, "center", "center");
11230
+ } finally {
11231
+ if (savedLayout) k.layoutManager = savedLayout;
11232
+ }
11222
11233
  k.setCoords();
11223
11234
  k.dirty = true;
11224
11235
  });
@@ -11234,20 +11245,7 @@ function applyWarpAwareSelectionBorders(selection) {
11234
11245
  selection.dirty = true;
11235
11246
  selection.__pixldocsAlignedAngle = targetAngle;
11236
11247
  try {
11237
- const kidSummary = kids.map((c) => ({
11238
- id: c.id ?? c.__pixldocsId,
11239
- type: c.type,
11240
- left: c.left,
11241
- top: c.top,
11242
- angle: c.angle,
11243
- scaleX: c.scaleX,
11244
- scaleY: c.scaleY,
11245
- originX: c.originX,
11246
- originY: c.originY,
11247
- width: c.width,
11248
- height: c.height
11249
- }));
11250
- console.info("[Pixldocs][rot-group-image-drift] aligned-on-select", {
11248
+ const payload = {
11251
11249
  targetAngle,
11252
11250
  selection: {
11253
11251
  left: selection.left,
@@ -11260,8 +11258,21 @@ function applyWarpAwareSelectionBorders(selection) {
11260
11258
  originX: selection.originX,
11261
11259
  originY: selection.originY
11262
11260
  },
11263
- kids: kidSummary
11264
- });
11261
+ kids: kids.map((c) => ({
11262
+ id: c.id ?? c.__pixldocsId,
11263
+ type: c.type,
11264
+ left: c.left,
11265
+ top: c.top,
11266
+ angle: c.angle,
11267
+ scaleX: c.scaleX,
11268
+ scaleY: c.scaleY,
11269
+ originX: c.originX,
11270
+ originY: c.originY,
11271
+ width: c.width,
11272
+ height: c.height
11273
+ }))
11274
+ };
11275
+ console.info("[Pixldocs][rot-group-image-drift] aligned-on-select " + JSON.stringify(payload));
11265
11276
  } catch {
11266
11277
  }
11267
11278
  }
@@ -14280,24 +14291,9 @@ const PageCanvas = react.forwardRef(
14280
14291
  try {
14281
14292
  const t = tr;
14282
14293
  if (t) {
14283
- const childSummary = (t._objects ?? []).map((c) => ({
14284
- id: getObjectId(c),
14285
- type: c.type,
14286
- left: c.left,
14287
- top: c.top,
14288
- angle: c.angle,
14289
- scaleX: c.scaleX,
14290
- scaleY: c.scaleY,
14291
- originX: c.originX,
14292
- originY: c.originY,
14293
- width: c.width,
14294
- height: c.height
14295
- }));
14296
- console.info("[Pixldocs][rot-group-image-drift] rotating", {
14294
+ const payload = {
14297
14295
  targetType: t.type,
14298
14296
  isAS: t instanceof fabric__namespace.ActiveSelection,
14299
- isGroup: t instanceof fabric__namespace.Group,
14300
- targetId: getObjectId(t),
14301
14297
  left: t.left,
14302
14298
  top: t.top,
14303
14299
  angle: t.angle,
@@ -14308,8 +14304,21 @@ const PageCanvas = react.forwardRef(
14308
14304
  originX: t.originX,
14309
14305
  originY: t.originY,
14310
14306
  childCount: (t._objects ?? []).length,
14311
- children: childSummary
14312
- });
14307
+ children: (t._objects ?? []).map((c) => ({
14308
+ id: getObjectId(c),
14309
+ type: c.type,
14310
+ left: c.left,
14311
+ top: c.top,
14312
+ angle: c.angle,
14313
+ scaleX: c.scaleX,
14314
+ scaleY: c.scaleY,
14315
+ originX: c.originX,
14316
+ originY: c.originY,
14317
+ width: c.width,
14318
+ height: c.height
14319
+ }))
14320
+ };
14321
+ console.info("[Pixldocs][rot-group-image-drift] rotating " + JSON.stringify(payload));
14313
14322
  }
14314
14323
  } catch {
14315
14324
  }
@@ -14348,24 +14357,9 @@ const PageCanvas = react.forwardRef(
14348
14357
  try {
14349
14358
  const t = e.target;
14350
14359
  if (t && (t.angle ?? 0) !== 0) {
14351
- const childSummary = (t._objects ?? []).map((c) => ({
14352
- id: getObjectId(c),
14353
- type: c.type,
14354
- left: c.left,
14355
- top: c.top,
14356
- angle: c.angle,
14357
- scaleX: c.scaleX,
14358
- scaleY: c.scaleY,
14359
- originX: c.originX,
14360
- originY: c.originY,
14361
- width: c.width,
14362
- height: c.height
14363
- }));
14364
- console.info("[Pixldocs][rot-group-image-drift] moving", {
14360
+ const payload = {
14365
14361
  targetType: t.type,
14366
14362
  isAS: t instanceof fabric__namespace.ActiveSelection,
14367
- isGroup: t instanceof fabric__namespace.Group,
14368
- targetId: getObjectId(t),
14369
14363
  left: t.left,
14370
14364
  top: t.top,
14371
14365
  angle: t.angle,
@@ -14376,8 +14370,21 @@ const PageCanvas = react.forwardRef(
14376
14370
  originX: t.originX,
14377
14371
  originY: t.originY,
14378
14372
  childCount: (t._objects ?? []).length,
14379
- children: childSummary
14380
- });
14373
+ children: (t._objects ?? []).map((c) => ({
14374
+ id: getObjectId(c),
14375
+ type: c.type,
14376
+ left: c.left,
14377
+ top: c.top,
14378
+ angle: c.angle,
14379
+ scaleX: c.scaleX,
14380
+ scaleY: c.scaleY,
14381
+ originX: c.originX,
14382
+ originY: c.originY,
14383
+ width: c.width,
14384
+ height: c.height
14385
+ }))
14386
+ };
14387
+ console.info("[Pixldocs][rot-group-image-drift] moving " + JSON.stringify(payload));
14381
14388
  }
14382
14389
  } catch {
14383
14390
  }
@@ -24485,9 +24492,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24485
24492
  }
24486
24493
  return svgString;
24487
24494
  }
24488
- const resolvedPackageVersion = "0.5.356";
24495
+ const resolvedPackageVersion = "0.5.358";
24489
24496
  const PACKAGE_VERSION = resolvedPackageVersion;
24490
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.356";
24497
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.358";
24491
24498
  const roundParityValue = (value) => {
24492
24499
  if (typeof value !== "number") return value;
24493
24500
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25301,7 +25308,7 @@ class PixldocsRenderer {
25301
25308
  await this.waitForCanvasScene(container, cloned, i);
25302
25309
  }
25303
25310
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25304
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CVOo3V8_.cjs"));
25311
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BjU5UnhU.cjs"));
25305
25312
  const prepared = preparePagesForExport(
25306
25313
  cloned.pages,
25307
25314
  canvasWidth,
@@ -27621,7 +27628,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27621
27628
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27622
27629
  sanitizeSvgTreeForPdf(svgToDraw);
27623
27630
  try {
27624
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CVOo3V8_.cjs"));
27631
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BjU5UnhU.cjs"));
27625
27632
  try {
27626
27633
  await logTextMeasurementDiagnostic(svgToDraw);
27627
27634
  } catch {
@@ -28018,4 +28025,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
28018
28025
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
28019
28026
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
28020
28027
  exports.warmTemplateFromForm = warmTemplateFromForm;
28021
- //# sourceMappingURL=index-CcfKFBH1.cjs.map
28028
+ //# sourceMappingURL=index-BMPgVllP.cjs.map