leafer-ui 1.10.0 → 1.11.0
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/web.cjs +39 -41
- package/dist/web.esm.js +39 -41
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +94 -76
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +95 -77
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/web.cjs
CHANGED
|
@@ -1400,30 +1400,31 @@ function fill(fill, ui, canvas, renderOptions) {
|
|
|
1400
1400
|
}
|
|
1401
1401
|
|
|
1402
1402
|
function fills(fills, ui, canvas, renderOptions) {
|
|
1403
|
-
let item;
|
|
1403
|
+
let item, originPaint, countImage;
|
|
1404
1404
|
for (let i = 0, len = fills.length; i < len; i++) {
|
|
1405
|
-
item = fills[i];
|
|
1405
|
+
item = fills[i], originPaint = item.originPaint;
|
|
1406
1406
|
if (item.image) {
|
|
1407
|
+
countImage ? countImage++ : countImage = 1;
|
|
1407
1408
|
if (draw.PaintImage.checkImage(item, !ui.__.__font, ui, canvas, renderOptions)) continue;
|
|
1408
1409
|
if (!item.style) {
|
|
1409
|
-
if (
|
|
1410
|
+
if (countImage === 1 && item.image.isPlacehold) ui.drawImagePlaceholder(item, canvas, renderOptions);
|
|
1410
1411
|
continue;
|
|
1411
1412
|
}
|
|
1412
1413
|
}
|
|
1413
1414
|
canvas.fillStyle = item.style;
|
|
1414
|
-
if (item.transform ||
|
|
1415
|
+
if (item.transform || originPaint.scaleFixed) {
|
|
1415
1416
|
canvas.save();
|
|
1416
1417
|
if (item.transform) canvas.transform(item.transform);
|
|
1417
|
-
if (
|
|
1418
|
+
if (originPaint.scaleFixed) {
|
|
1418
1419
|
const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
1419
|
-
if (
|
|
1420
|
+
if (originPaint.scaleFixed === true || originPaint.scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) canvas.scale(1 / scaleX, 1 / scaleY);
|
|
1420
1421
|
}
|
|
1421
|
-
if (
|
|
1422
|
+
if (originPaint.blendMode) canvas.blendMode = originPaint.blendMode;
|
|
1422
1423
|
fillPathOrText(ui, canvas, renderOptions);
|
|
1423
1424
|
canvas.restore();
|
|
1424
1425
|
} else {
|
|
1425
|
-
if (
|
|
1426
|
-
canvas.saveBlendMode(
|
|
1426
|
+
if (originPaint.blendMode) {
|
|
1427
|
+
canvas.saveBlendMode(originPaint.blendMode);
|
|
1427
1428
|
fillPathOrText(ui, canvas, renderOptions);
|
|
1428
1429
|
canvas.restoreBlendMode();
|
|
1429
1430
|
} else fillPathOrText(ui, canvas, renderOptions);
|
|
@@ -1576,8 +1577,8 @@ function drawStrokesStyle(strokes, strokeWidthScale, isText, ui, canvas, renderO
|
|
|
1576
1577
|
const {strokeStyle: strokeStyle} = item;
|
|
1577
1578
|
strokeStyle ? canvas.setStroke(item.style, data.__getRealStrokeWidth(strokeStyle) * strokeWidthScale, data, strokeStyle) : canvas.setStroke(item.style, data.__strokeWidth * strokeWidthScale, data);
|
|
1578
1579
|
} else canvas.strokeStyle = item.style;
|
|
1579
|
-
if (item.blendMode) {
|
|
1580
|
-
canvas.saveBlendMode(item.blendMode);
|
|
1580
|
+
if (item.originPaint.blendMode) {
|
|
1581
|
+
canvas.saveBlendMode(item.originPaint.blendMode);
|
|
1581
1582
|
isText ? draw.Paint.drawTextStroke(ui, canvas, renderOptions) : canvas.stroke();
|
|
1582
1583
|
canvas.restoreBlendMode();
|
|
1583
1584
|
} else {
|
|
@@ -1674,62 +1675,63 @@ function compute(attrName, ui) {
|
|
|
1674
1675
|
if (leafPaints.some(item => item.image)) isAlphaPixel = true;
|
|
1675
1676
|
isTransparent = true;
|
|
1676
1677
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1678
|
+
if (attrName === "fill") {
|
|
1679
|
+
stintSet(data, "__isAlphaPixelFill", isAlphaPixel);
|
|
1680
|
+
stintSet(data, "__isTransparentFill", isTransparent);
|
|
1681
|
+
} else {
|
|
1682
|
+
stintSet(data, "__isAlphaPixelStroke", isAlphaPixel);
|
|
1683
|
+
stintSet(data, "__isTransparentStroke", isTransparent);
|
|
1684
|
+
stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
1685
|
+
}
|
|
1681
1686
|
} else {
|
|
1682
|
-
|
|
1683
|
-
stintSet(data, "__isTransparentStroke", isTransparent);
|
|
1684
|
-
stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
1687
|
+
data.__removePaint(attrName, false);
|
|
1685
1688
|
}
|
|
1686
1689
|
}
|
|
1687
1690
|
|
|
1688
1691
|
function getLeafPaint(attrName, paint, ui) {
|
|
1689
1692
|
if (!core.isObject(paint) || paint.visible === false || paint.opacity === 0) return undefined;
|
|
1690
|
-
let
|
|
1693
|
+
let leafPaint;
|
|
1691
1694
|
const {boxBounds: boxBounds} = ui.__layout;
|
|
1692
1695
|
switch (paint.type) {
|
|
1693
1696
|
case "image":
|
|
1694
|
-
|
|
1697
|
+
leafPaint = draw.PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url]);
|
|
1695
1698
|
break;
|
|
1696
1699
|
|
|
1697
1700
|
case "linear":
|
|
1698
|
-
|
|
1701
|
+
leafPaint = draw.PaintGradient.linearGradient(paint, boxBounds);
|
|
1699
1702
|
break;
|
|
1700
1703
|
|
|
1701
1704
|
case "radial":
|
|
1702
|
-
|
|
1705
|
+
leafPaint = draw.PaintGradient.radialGradient(paint, boxBounds);
|
|
1703
1706
|
break;
|
|
1704
1707
|
|
|
1705
1708
|
case "angular":
|
|
1706
|
-
|
|
1709
|
+
leafPaint = draw.PaintGradient.conicGradient(paint, boxBounds);
|
|
1707
1710
|
break;
|
|
1708
1711
|
|
|
1709
1712
|
case "solid":
|
|
1710
1713
|
const {type: type, color: color, opacity: opacity} = paint;
|
|
1711
|
-
|
|
1714
|
+
leafPaint = {
|
|
1712
1715
|
type: type,
|
|
1713
1716
|
style: draw.ColorConvert.string(color, opacity)
|
|
1714
1717
|
};
|
|
1715
1718
|
break;
|
|
1716
1719
|
|
|
1717
1720
|
default:
|
|
1718
|
-
if (!core.isUndefined(paint.r))
|
|
1721
|
+
if (!core.isUndefined(paint.r)) leafPaint = {
|
|
1719
1722
|
type: "solid",
|
|
1720
1723
|
style: draw.ColorConvert.string(paint)
|
|
1721
1724
|
};
|
|
1722
1725
|
}
|
|
1723
|
-
if (
|
|
1724
|
-
|
|
1726
|
+
if (leafPaint) {
|
|
1727
|
+
leafPaint.originPaint = paint;
|
|
1728
|
+
if (core.isString(leafPaint.style) && hasTransparent$1(leafPaint.style)) leafPaint.isTransparent = true;
|
|
1725
1729
|
if (paint.style) {
|
|
1726
1730
|
if (paint.style.strokeWidth === 0) return undefined;
|
|
1727
|
-
|
|
1731
|
+
leafPaint.strokeStyle = paint.style;
|
|
1728
1732
|
}
|
|
1729
|
-
if (paint.editing) data.editing = paint.editing;
|
|
1730
|
-
if (paint.blendMode) data.blendMode = paint.blendMode;
|
|
1731
1733
|
}
|
|
1732
|
-
return
|
|
1734
|
+
return leafPaint;
|
|
1733
1735
|
}
|
|
1734
1736
|
|
|
1735
1737
|
const PaintModule = {
|
|
@@ -1862,10 +1864,6 @@ const tempScaleData = {};
|
|
|
1862
1864
|
const tempImage = {};
|
|
1863
1865
|
|
|
1864
1866
|
function createData(leafPaint, image, paint, box) {
|
|
1865
|
-
const {changeful: changeful, sync: sync, scaleFixed: scaleFixed} = paint;
|
|
1866
|
-
if (changeful) leafPaint.changeful = changeful;
|
|
1867
|
-
if (sync) leafPaint.sync = sync;
|
|
1868
|
-
if (scaleFixed) leafPaint.scaleFixed = scaleFixed;
|
|
1869
1867
|
leafPaint.data = draw.PaintImage.getPatternData(paint, box, image);
|
|
1870
1868
|
}
|
|
1871
1869
|
|
|
@@ -2125,14 +2123,14 @@ function getPatternFixScale(paint, imageScaleX, imageScaleY) {
|
|
|
2125
2123
|
|
|
2126
2124
|
function checkImage(paint, drawImage, ui, canvas, renderOptions) {
|
|
2127
2125
|
const {scaleX: scaleX, scaleY: scaleY} = draw.PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions);
|
|
2128
|
-
const {image: image, data: data} = paint, {exporting: exporting} = renderOptions;
|
|
2126
|
+
const {image: image, data: data, originPaint: originPaint} = paint, {exporting: exporting} = renderOptions;
|
|
2129
2127
|
if (!data || paint.patternId === scaleX + "-" + scaleY && !exporting) {
|
|
2130
2128
|
return false;
|
|
2131
2129
|
} else {
|
|
2132
2130
|
if (drawImage) {
|
|
2133
2131
|
if (data.repeat) {
|
|
2134
2132
|
drawImage = false;
|
|
2135
|
-
} else if (!(
|
|
2133
|
+
} else if (!(originPaint.changeful || core.Platform.name === "miniapp" && core.ResizeEvent.isResizing(ui) || exporting)) {
|
|
2136
2134
|
drawImage = core.Platform.image.isLarge(image, scaleX, scaleY);
|
|
2137
2135
|
}
|
|
2138
2136
|
}
|
|
@@ -2144,16 +2142,16 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
|
|
|
2144
2142
|
draw.PaintImage.drawImage(paint, scaleX, scaleY, ui, canvas, renderOptions);
|
|
2145
2143
|
return true;
|
|
2146
2144
|
} else {
|
|
2147
|
-
if (!paint.style ||
|
|
2145
|
+
if (!paint.style || originPaint.sync || exporting) draw.PaintImage.createPattern(paint, ui, canvas, renderOptions); else draw.PaintImage.createPatternTask(paint, ui, canvas, renderOptions);
|
|
2148
2146
|
return false;
|
|
2149
2147
|
}
|
|
2150
2148
|
}
|
|
2151
2149
|
}
|
|
2152
2150
|
|
|
2153
2151
|
function drawImage(paint, _imageScaleX, _imageScaleY, ui, canvas, _renderOptions) {
|
|
2154
|
-
const {data: data, image: image, blendMode: blendMode} = paint, {opacity: opacity, transform: transform} = data, view = image.getFull(data.filters), u = ui.__;
|
|
2152
|
+
const {data: data, image: image} = paint, {blendMode: blendMode} = paint.originPaint, {opacity: opacity, transform: transform} = data, view = image.getFull(data.filters), u = ui.__;
|
|
2155
2153
|
let {width: width, height: height} = image, clipUI;
|
|
2156
|
-
if (transform && !transform.onlyScale ||
|
|
2154
|
+
if ((clipUI = transform && !transform.onlyScale || u.path || u.cornerRadius) || opacity || blendMode) {
|
|
2157
2155
|
canvas.save();
|
|
2158
2156
|
clipUI && canvas.clipUI(ui);
|
|
2159
2157
|
blendMode && (canvas.blendMode = blendMode);
|
|
@@ -2168,7 +2166,7 @@ function drawImage(paint, _imageScaleX, _imageScaleY, ui, canvas, _renderOptions
|
|
|
2168
2166
|
}
|
|
2169
2167
|
|
|
2170
2168
|
function getImageRenderScaleData(paint, ui, canvas, _renderOptions) {
|
|
2171
|
-
const scaleData = ui.getRenderScaleData(true, paint.scaleFixed), {data: data} = paint;
|
|
2169
|
+
const scaleData = ui.getRenderScaleData(true, paint.originPaint.scaleFixed), {data: data} = paint;
|
|
2172
2170
|
if (canvas) {
|
|
2173
2171
|
const {pixelRatio: pixelRatio} = canvas;
|
|
2174
2172
|
scaleData.scaleX *= pixelRatio;
|
package/dist/web.esm.js
CHANGED
|
@@ -1404,30 +1404,31 @@ function fill(fill, ui, canvas, renderOptions) {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
|
|
1406
1406
|
function fills(fills, ui, canvas, renderOptions) {
|
|
1407
|
-
let item;
|
|
1407
|
+
let item, originPaint, countImage;
|
|
1408
1408
|
for (let i = 0, len = fills.length; i < len; i++) {
|
|
1409
|
-
item = fills[i];
|
|
1409
|
+
item = fills[i], originPaint = item.originPaint;
|
|
1410
1410
|
if (item.image) {
|
|
1411
|
+
countImage ? countImage++ : countImage = 1;
|
|
1411
1412
|
if (PaintImage.checkImage(item, !ui.__.__font, ui, canvas, renderOptions)) continue;
|
|
1412
1413
|
if (!item.style) {
|
|
1413
|
-
if (
|
|
1414
|
+
if (countImage === 1 && item.image.isPlacehold) ui.drawImagePlaceholder(item, canvas, renderOptions);
|
|
1414
1415
|
continue;
|
|
1415
1416
|
}
|
|
1416
1417
|
}
|
|
1417
1418
|
canvas.fillStyle = item.style;
|
|
1418
|
-
if (item.transform ||
|
|
1419
|
+
if (item.transform || originPaint.scaleFixed) {
|
|
1419
1420
|
canvas.save();
|
|
1420
1421
|
if (item.transform) canvas.transform(item.transform);
|
|
1421
|
-
if (
|
|
1422
|
+
if (originPaint.scaleFixed) {
|
|
1422
1423
|
const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
1423
|
-
if (
|
|
1424
|
+
if (originPaint.scaleFixed === true || originPaint.scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) canvas.scale(1 / scaleX, 1 / scaleY);
|
|
1424
1425
|
}
|
|
1425
|
-
if (
|
|
1426
|
+
if (originPaint.blendMode) canvas.blendMode = originPaint.blendMode;
|
|
1426
1427
|
fillPathOrText(ui, canvas, renderOptions);
|
|
1427
1428
|
canvas.restore();
|
|
1428
1429
|
} else {
|
|
1429
|
-
if (
|
|
1430
|
-
canvas.saveBlendMode(
|
|
1430
|
+
if (originPaint.blendMode) {
|
|
1431
|
+
canvas.saveBlendMode(originPaint.blendMode);
|
|
1431
1432
|
fillPathOrText(ui, canvas, renderOptions);
|
|
1432
1433
|
canvas.restoreBlendMode();
|
|
1433
1434
|
} else fillPathOrText(ui, canvas, renderOptions);
|
|
@@ -1580,8 +1581,8 @@ function drawStrokesStyle(strokes, strokeWidthScale, isText, ui, canvas, renderO
|
|
|
1580
1581
|
const {strokeStyle: strokeStyle} = item;
|
|
1581
1582
|
strokeStyle ? canvas.setStroke(item.style, data.__getRealStrokeWidth(strokeStyle) * strokeWidthScale, data, strokeStyle) : canvas.setStroke(item.style, data.__strokeWidth * strokeWidthScale, data);
|
|
1582
1583
|
} else canvas.strokeStyle = item.style;
|
|
1583
|
-
if (item.blendMode) {
|
|
1584
|
-
canvas.saveBlendMode(item.blendMode);
|
|
1584
|
+
if (item.originPaint.blendMode) {
|
|
1585
|
+
canvas.saveBlendMode(item.originPaint.blendMode);
|
|
1585
1586
|
isText ? Paint.drawTextStroke(ui, canvas, renderOptions) : canvas.stroke();
|
|
1586
1587
|
canvas.restoreBlendMode();
|
|
1587
1588
|
} else {
|
|
@@ -1678,62 +1679,63 @@ function compute(attrName, ui) {
|
|
|
1678
1679
|
if (leafPaints.some(item => item.image)) isAlphaPixel = true;
|
|
1679
1680
|
isTransparent = true;
|
|
1680
1681
|
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1682
|
+
if (attrName === "fill") {
|
|
1683
|
+
stintSet(data, "__isAlphaPixelFill", isAlphaPixel);
|
|
1684
|
+
stintSet(data, "__isTransparentFill", isTransparent);
|
|
1685
|
+
} else {
|
|
1686
|
+
stintSet(data, "__isAlphaPixelStroke", isAlphaPixel);
|
|
1687
|
+
stintSet(data, "__isTransparentStroke", isTransparent);
|
|
1688
|
+
stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
1689
|
+
}
|
|
1685
1690
|
} else {
|
|
1686
|
-
|
|
1687
|
-
stintSet(data, "__isTransparentStroke", isTransparent);
|
|
1688
|
-
stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
|
|
1691
|
+
data.__removePaint(attrName, false);
|
|
1689
1692
|
}
|
|
1690
1693
|
}
|
|
1691
1694
|
|
|
1692
1695
|
function getLeafPaint(attrName, paint, ui) {
|
|
1693
1696
|
if (!isObject(paint) || paint.visible === false || paint.opacity === 0) return undefined;
|
|
1694
|
-
let
|
|
1697
|
+
let leafPaint;
|
|
1695
1698
|
const {boxBounds: boxBounds} = ui.__layout;
|
|
1696
1699
|
switch (paint.type) {
|
|
1697
1700
|
case "image":
|
|
1698
|
-
|
|
1701
|
+
leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url]);
|
|
1699
1702
|
break;
|
|
1700
1703
|
|
|
1701
1704
|
case "linear":
|
|
1702
|
-
|
|
1705
|
+
leafPaint = PaintGradient.linearGradient(paint, boxBounds);
|
|
1703
1706
|
break;
|
|
1704
1707
|
|
|
1705
1708
|
case "radial":
|
|
1706
|
-
|
|
1709
|
+
leafPaint = PaintGradient.radialGradient(paint, boxBounds);
|
|
1707
1710
|
break;
|
|
1708
1711
|
|
|
1709
1712
|
case "angular":
|
|
1710
|
-
|
|
1713
|
+
leafPaint = PaintGradient.conicGradient(paint, boxBounds);
|
|
1711
1714
|
break;
|
|
1712
1715
|
|
|
1713
1716
|
case "solid":
|
|
1714
1717
|
const {type: type, color: color, opacity: opacity} = paint;
|
|
1715
|
-
|
|
1718
|
+
leafPaint = {
|
|
1716
1719
|
type: type,
|
|
1717
1720
|
style: ColorConvert.string(color, opacity)
|
|
1718
1721
|
};
|
|
1719
1722
|
break;
|
|
1720
1723
|
|
|
1721
1724
|
default:
|
|
1722
|
-
if (!isUndefined(paint.r))
|
|
1725
|
+
if (!isUndefined(paint.r)) leafPaint = {
|
|
1723
1726
|
type: "solid",
|
|
1724
1727
|
style: ColorConvert.string(paint)
|
|
1725
1728
|
};
|
|
1726
1729
|
}
|
|
1727
|
-
if (
|
|
1728
|
-
|
|
1730
|
+
if (leafPaint) {
|
|
1731
|
+
leafPaint.originPaint = paint;
|
|
1732
|
+
if (isString(leafPaint.style) && hasTransparent$1(leafPaint.style)) leafPaint.isTransparent = true;
|
|
1729
1733
|
if (paint.style) {
|
|
1730
1734
|
if (paint.style.strokeWidth === 0) return undefined;
|
|
1731
|
-
|
|
1735
|
+
leafPaint.strokeStyle = paint.style;
|
|
1732
1736
|
}
|
|
1733
|
-
if (paint.editing) data.editing = paint.editing;
|
|
1734
|
-
if (paint.blendMode) data.blendMode = paint.blendMode;
|
|
1735
1737
|
}
|
|
1736
|
-
return
|
|
1738
|
+
return leafPaint;
|
|
1737
1739
|
}
|
|
1738
1740
|
|
|
1739
1741
|
const PaintModule = {
|
|
@@ -1866,10 +1868,6 @@ const tempScaleData = {};
|
|
|
1866
1868
|
const tempImage = {};
|
|
1867
1869
|
|
|
1868
1870
|
function createData(leafPaint, image, paint, box) {
|
|
1869
|
-
const {changeful: changeful, sync: sync, scaleFixed: scaleFixed} = paint;
|
|
1870
|
-
if (changeful) leafPaint.changeful = changeful;
|
|
1871
|
-
if (sync) leafPaint.sync = sync;
|
|
1872
|
-
if (scaleFixed) leafPaint.scaleFixed = scaleFixed;
|
|
1873
1871
|
leafPaint.data = PaintImage.getPatternData(paint, box, image);
|
|
1874
1872
|
}
|
|
1875
1873
|
|
|
@@ -2129,14 +2127,14 @@ function getPatternFixScale(paint, imageScaleX, imageScaleY) {
|
|
|
2129
2127
|
|
|
2130
2128
|
function checkImage(paint, drawImage, ui, canvas, renderOptions) {
|
|
2131
2129
|
const {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions);
|
|
2132
|
-
const {image: image, data: data} = paint, {exporting: exporting} = renderOptions;
|
|
2130
|
+
const {image: image, data: data, originPaint: originPaint} = paint, {exporting: exporting} = renderOptions;
|
|
2133
2131
|
if (!data || paint.patternId === scaleX + "-" + scaleY && !exporting) {
|
|
2134
2132
|
return false;
|
|
2135
2133
|
} else {
|
|
2136
2134
|
if (drawImage) {
|
|
2137
2135
|
if (data.repeat) {
|
|
2138
2136
|
drawImage = false;
|
|
2139
|
-
} else if (!(
|
|
2137
|
+
} else if (!(originPaint.changeful || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
|
|
2140
2138
|
drawImage = Platform.image.isLarge(image, scaleX, scaleY);
|
|
2141
2139
|
}
|
|
2142
2140
|
}
|
|
@@ -2148,16 +2146,16 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
|
|
|
2148
2146
|
PaintImage.drawImage(paint, scaleX, scaleY, ui, canvas, renderOptions);
|
|
2149
2147
|
return true;
|
|
2150
2148
|
} else {
|
|
2151
|
-
if (!paint.style ||
|
|
2149
|
+
if (!paint.style || originPaint.sync || exporting) PaintImage.createPattern(paint, ui, canvas, renderOptions); else PaintImage.createPatternTask(paint, ui, canvas, renderOptions);
|
|
2152
2150
|
return false;
|
|
2153
2151
|
}
|
|
2154
2152
|
}
|
|
2155
2153
|
}
|
|
2156
2154
|
|
|
2157
2155
|
function drawImage(paint, _imageScaleX, _imageScaleY, ui, canvas, _renderOptions) {
|
|
2158
|
-
const {data: data, image: image, blendMode: blendMode} = paint, {opacity: opacity, transform: transform} = data, view = image.getFull(data.filters), u = ui.__;
|
|
2156
|
+
const {data: data, image: image} = paint, {blendMode: blendMode} = paint.originPaint, {opacity: opacity, transform: transform} = data, view = image.getFull(data.filters), u = ui.__;
|
|
2159
2157
|
let {width: width, height: height} = image, clipUI;
|
|
2160
|
-
if (transform && !transform.onlyScale ||
|
|
2158
|
+
if ((clipUI = transform && !transform.onlyScale || u.path || u.cornerRadius) || opacity || blendMode) {
|
|
2161
2159
|
canvas.save();
|
|
2162
2160
|
clipUI && canvas.clipUI(ui);
|
|
2163
2161
|
blendMode && (canvas.blendMode = blendMode);
|
|
@@ -2172,7 +2170,7 @@ function drawImage(paint, _imageScaleX, _imageScaleY, ui, canvas, _renderOptions
|
|
|
2172
2170
|
}
|
|
2173
2171
|
|
|
2174
2172
|
function getImageRenderScaleData(paint, ui, canvas, _renderOptions) {
|
|
2175
|
-
const scaleData = ui.getRenderScaleData(true, paint.scaleFixed), {data: data} = paint;
|
|
2173
|
+
const scaleData = ui.getRenderScaleData(true, paint.originPaint.scaleFixed), {data: data} = paint;
|
|
2176
2174
|
if (canvas) {
|
|
2177
2175
|
const {pixelRatio: pixelRatio} = canvas;
|
|
2178
2176
|
scaleData.scaleX *= pixelRatio;
|