leafer-ui 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.
- package/README.md +1 -1
- package/dist/web.esm.js +7 -9
- package/dist/web.esm.min.js +1 -1
- package/dist/web.js +4 -3
- package/dist/web.min.js +1 -1
- package/dist/web.module.js +4 -3
- package/dist/web.module.min.js +1 -1
- package/package.json +3 -3
package/dist/web.module.js
CHANGED
|
@@ -11366,7 +11366,8 @@ const ExportModule = {
|
|
|
11366
11366
|
leafer.waitViewCompleted(() => __awaiter(this, void 0, void 0, function* () {
|
|
11367
11367
|
let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
|
|
11368
11368
|
options = FileHelper.getExportOptions(options);
|
|
11369
|
-
const { scale,
|
|
11369
|
+
const { scale, slice, trim } = options;
|
|
11370
|
+
const pixelRatio = options.pixelRatio || 1;
|
|
11370
11371
|
const screenshot = options.screenshot || leaf.isApp;
|
|
11371
11372
|
const fill = options.fill === undefined ? ((leaf.isLeafer && screenshot) ? leaf.fill : '') : options.fill;
|
|
11372
11373
|
const needFill = FileHelper.isOpaqueImage(filename) || fill, matrix = new Matrix();
|
|
@@ -11386,7 +11387,7 @@ const ExportModule = {
|
|
|
11386
11387
|
width *= scale, height *= scale;
|
|
11387
11388
|
scaleX *= scale, scaleY *= scale;
|
|
11388
11389
|
}
|
|
11389
|
-
let canvas = Creator.canvas({ width, height, pixelRatio });
|
|
11390
|
+
let canvas = Creator.canvas({ width: Math.ceil(width), height: Math.ceil(width), pixelRatio });
|
|
11390
11391
|
const renderOptions = { matrix: matrix.translate(-x, -y).withScale(scaleX, scaleY) };
|
|
11391
11392
|
if (slice) {
|
|
11392
11393
|
leaf = leafer;
|
|
@@ -11405,7 +11406,7 @@ const ExportModule = {
|
|
|
11405
11406
|
if (needFill)
|
|
11406
11407
|
canvas.fillWorld(canvas.bounds, fill || '#FFFFFF', 'destination-over');
|
|
11407
11408
|
const data = filename === 'canvas' ? canvas : yield canvas.export(filename, options);
|
|
11408
|
-
over({ data, renderBounds, trimBounds });
|
|
11409
|
+
over({ data, width: canvas.pixelWidth, height: canvas.pixelHeight, renderBounds, trimBounds });
|
|
11409
11410
|
}));
|
|
11410
11411
|
}
|
|
11411
11412
|
else {
|