@inditextech/weave-sdk 0.64.0 → 0.64.1

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/dist/sdk.cjs CHANGED
@@ -22053,7 +22053,7 @@ var WeaveRegisterManager = class {
22053
22053
 
22054
22054
  //#endregion
22055
22055
  //#region package.json
22056
- var version = "0.64.0";
22056
+ var version = "0.64.1";
22057
22057
 
22058
22058
  //#endregion
22059
22059
  //#region src/managers/setup.ts
@@ -22448,35 +22448,31 @@ var WeaveExportManager = class {
22448
22448
  const backgroundRect = background.getClientRect();
22449
22449
  stage.batchDraw();
22450
22450
  const composites = [];
22451
- const maxRenderSize = 1920;
22452
- const tileSize = Math.floor(maxRenderSize / pixelRatio);
22453
22451
  const imageWidth = Math.round(backgroundRect.width);
22454
22452
  const imageHeight = Math.round(backgroundRect.height);
22455
- let compositeX = 0;
22456
- let compositeY = 0;
22457
- for (let y = Math.round(backgroundRect.y); y < imageHeight; y += tileSize) {
22458
- compositeX = 0;
22459
- for (let x = Math.round(backgroundRect.x); x < imageWidth; x += tileSize) {
22460
- const width = Math.min(tileSize, imageWidth - x);
22461
- const height = Math.min(tileSize, imageHeight - y);
22462
- const canvas = await exportGroup.toCanvas({
22463
- x,
22464
- y,
22465
- width,
22466
- height,
22467
- mimeType: format$2,
22468
- pixelRatio,
22469
- quality: options.quality ?? 1
22470
- });
22471
- const buffer = canvas.toBuffer();
22472
- composites.push({
22473
- top: compositeY * pixelRatio,
22474
- left: compositeX * pixelRatio,
22475
- input: buffer
22476
- });
22477
- compositeX = compositeX + tileSize;
22478
- }
22479
- compositeY = compositeY + tileSize;
22453
+ const maxRenderSize = 1920;
22454
+ const cols = Math.ceil(imageWidth / maxRenderSize);
22455
+ const rows = Math.ceil(imageHeight / maxRenderSize);
22456
+ const tileWidth = Math.floor(imageWidth / cols);
22457
+ const tileHeight = Math.floor(imageHeight / rows);
22458
+ for (let y = 0; y < imageHeight; y += tileHeight) for (let x = 0; x < imageWidth; x += tileWidth) {
22459
+ const width = Math.min(tileWidth, imageWidth - x);
22460
+ const height = Math.min(tileHeight, imageHeight - y);
22461
+ const canvas = await exportGroup.toCanvas({
22462
+ x: Math.round(backgroundRect.x) + x,
22463
+ y: Math.round(backgroundRect.y) + y,
22464
+ width,
22465
+ height,
22466
+ mimeType: format$2,
22467
+ pixelRatio,
22468
+ quality: options.quality ?? 1
22469
+ });
22470
+ const buffer = canvas.toBuffer();
22471
+ composites.push({
22472
+ top: y * pixelRatio,
22473
+ left: x * pixelRatio,
22474
+ input: buffer
22475
+ });
22480
22476
  }
22481
22477
  exportGroup.destroy();
22482
22478
  stage.position(originalPosition);
package/dist/sdk.js CHANGED
@@ -22053,7 +22053,7 @@ var WeaveRegisterManager = class {
22053
22053
 
22054
22054
  //#endregion
22055
22055
  //#region package.json
22056
- var version = "0.64.0";
22056
+ var version = "0.64.1";
22057
22057
 
22058
22058
  //#endregion
22059
22059
  //#region src/managers/setup.ts
@@ -22448,35 +22448,31 @@ var WeaveExportManager = class {
22448
22448
  const backgroundRect = background.getClientRect();
22449
22449
  stage.batchDraw();
22450
22450
  const composites = [];
22451
- const maxRenderSize = 1920;
22452
- const tileSize = Math.floor(maxRenderSize / pixelRatio);
22453
22451
  const imageWidth = Math.round(backgroundRect.width);
22454
22452
  const imageHeight = Math.round(backgroundRect.height);
22455
- let compositeX = 0;
22456
- let compositeY = 0;
22457
- for (let y = Math.round(backgroundRect.y); y < imageHeight; y += tileSize) {
22458
- compositeX = 0;
22459
- for (let x = Math.round(backgroundRect.x); x < imageWidth; x += tileSize) {
22460
- const width = Math.min(tileSize, imageWidth - x);
22461
- const height = Math.min(tileSize, imageHeight - y);
22462
- const canvas = await exportGroup.toCanvas({
22463
- x,
22464
- y,
22465
- width,
22466
- height,
22467
- mimeType: format$2,
22468
- pixelRatio,
22469
- quality: options.quality ?? 1
22470
- });
22471
- const buffer = canvas.toBuffer();
22472
- composites.push({
22473
- top: compositeY * pixelRatio,
22474
- left: compositeX * pixelRatio,
22475
- input: buffer
22476
- });
22477
- compositeX = compositeX + tileSize;
22478
- }
22479
- compositeY = compositeY + tileSize;
22453
+ const maxRenderSize = 1920;
22454
+ const cols = Math.ceil(imageWidth / maxRenderSize);
22455
+ const rows = Math.ceil(imageHeight / maxRenderSize);
22456
+ const tileWidth = Math.floor(imageWidth / cols);
22457
+ const tileHeight = Math.floor(imageHeight / rows);
22458
+ for (let y = 0; y < imageHeight; y += tileHeight) for (let x = 0; x < imageWidth; x += tileWidth) {
22459
+ const width = Math.min(tileWidth, imageWidth - x);
22460
+ const height = Math.min(tileHeight, imageHeight - y);
22461
+ const canvas = await exportGroup.toCanvas({
22462
+ x: Math.round(backgroundRect.x) + x,
22463
+ y: Math.round(backgroundRect.y) + y,
22464
+ width,
22465
+ height,
22466
+ mimeType: format$2,
22467
+ pixelRatio,
22468
+ quality: options.quality ?? 1
22469
+ });
22470
+ const buffer = canvas.toBuffer();
22471
+ composites.push({
22472
+ top: y * pixelRatio,
22473
+ left: x * pixelRatio,
22474
+ input: buffer
22475
+ });
22480
22476
  }
22481
22477
  exportGroup.destroy();
22482
22478
  stage.position(originalPosition);