@leafer-draw/worker 1.0.0-rc.10 → 1.0.0-rc.11

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.
@@ -9353,7 +9353,8 @@ const ExportModule = {
9353
9353
  leafer.waitViewCompleted(() => __awaiter(this, void 0, void 0, function* () {
9354
9354
  let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
9355
9355
  options = FileHelper.getExportOptions(options);
9356
- const { scale, pixelRatio, slice, trim } = options;
9356
+ const { scale, slice, trim } = options;
9357
+ const pixelRatio = options.pixelRatio || 1;
9357
9358
  const screenshot = options.screenshot || leaf.isApp;
9358
9359
  const fill = options.fill === undefined ? ((leaf.isLeafer && screenshot) ? leaf.fill : '') : options.fill;
9359
9360
  const needFill = FileHelper.isOpaqueImage(filename) || fill, matrix = new Matrix();
@@ -9373,7 +9374,7 @@ const ExportModule = {
9373
9374
  width *= scale, height *= scale;
9374
9375
  scaleX *= scale, scaleY *= scale;
9375
9376
  }
9376
- let canvas = Creator.canvas({ width, height, pixelRatio });
9377
+ let canvas = Creator.canvas({ width: Math.ceil(width), height: Math.ceil(width), pixelRatio });
9377
9378
  const renderOptions = { matrix: matrix.translate(-x, -y).withScale(scaleX, scaleY) };
9378
9379
  if (slice) {
9379
9380
  leaf = leafer;
@@ -9392,7 +9393,7 @@ const ExportModule = {
9392
9393
  if (needFill)
9393
9394
  canvas.fillWorld(canvas.bounds, fill || '#FFFFFF', 'destination-over');
9394
9395
  const data = filename === 'canvas' ? canvas : yield canvas.export(filename, options);
9395
- over({ data, renderBounds, trimBounds });
9396
+ over({ data, width: canvas.pixelWidth, height: canvas.pixelHeight, renderBounds, trimBounds });
9396
9397
  }));
9397
9398
  }
9398
9399
  else {