@leafer-ui/node 1.9.6 → 1.9.8
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/node.cjs +120 -88
- package/dist/node.esm.js +122 -90
- package/dist/node.esm.min.js +1 -1
- package/dist/node.esm.min.js.map +1 -1
- package/dist/node.min.cjs +1 -1
- package/dist/node.min.cjs.map +1 -1
- package/package.json +12 -12
package/dist/node.cjs
CHANGED
|
@@ -454,6 +454,7 @@ class Renderer {
|
|
|
454
454
|
usePartRender: true,
|
|
455
455
|
maxFPS: 120
|
|
456
456
|
};
|
|
457
|
+
this.frames = [];
|
|
457
458
|
this.target = target;
|
|
458
459
|
this.canvas = canvas;
|
|
459
460
|
if (userConfig) this.config = core.DataHelper.default(userConfig, this.config);
|
|
@@ -583,7 +584,7 @@ class Renderer {
|
|
|
583
584
|
};
|
|
584
585
|
if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
|
|
585
586
|
if (core.Debug.showRepaint) core.Debug.drawRepaint(canvas, bounds);
|
|
586
|
-
this.target
|
|
587
|
+
core.Platform.render(this.target, canvas, options);
|
|
587
588
|
this.renderBounds = realBounds = realBounds || bounds;
|
|
588
589
|
this.renderOptions = options;
|
|
589
590
|
this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
|
|
@@ -606,12 +607,15 @@ class Renderer {
|
|
|
606
607
|
const target = this.target;
|
|
607
608
|
if (this.requestTime || !target) return;
|
|
608
609
|
if (target.parentApp) return target.parentApp.requestRender(false);
|
|
609
|
-
|
|
610
|
+
this.requestTime = this.frameTime || Date.now();
|
|
610
611
|
const render = () => {
|
|
611
|
-
const nowFPS = 1e3 / (Date.now() - requestTime);
|
|
612
|
+
const nowFPS = 1e3 / ((this.frameTime = Date.now()) - this.requestTime);
|
|
612
613
|
const {maxFPS: maxFPS} = this.config;
|
|
613
|
-
if (maxFPS && nowFPS > maxFPS
|
|
614
|
-
|
|
614
|
+
if (maxFPS && nowFPS > maxFPS) return core.Platform.requestRender(render);
|
|
615
|
+
const {frames: frames} = this;
|
|
616
|
+
if (frames.length > 30) frames.shift();
|
|
617
|
+
frames.push(nowFPS);
|
|
618
|
+
this.FPS = Math.round(frames.reduce((a, b) => a + b, 0) / frames.length);
|
|
615
619
|
this.requestTime = 0;
|
|
616
620
|
this.checkRender();
|
|
617
621
|
};
|
|
@@ -859,6 +863,15 @@ Object.assign(core.Creator, {
|
|
|
859
863
|
|
|
860
864
|
core.Platform.layout = Layouter.fullLayout;
|
|
861
865
|
|
|
866
|
+
core.Platform.render = function(target, canvas, options) {
|
|
867
|
+
const topOptions = Object.assign(Object.assign({}, options), {
|
|
868
|
+
topRendering: true
|
|
869
|
+
});
|
|
870
|
+
options.topList = new core.LeafList;
|
|
871
|
+
target.__render(canvas, options);
|
|
872
|
+
if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
|
|
873
|
+
};
|
|
874
|
+
|
|
862
875
|
function fillText(ui, canvas) {
|
|
863
876
|
const data = ui.__, {rows: rows, decorationY: decorationY} = data.__textDrawData;
|
|
864
877
|
if (data.__isPlacehold && data.placeholderColor) canvas.fillStyle = data.placeholderColor;
|
|
@@ -1052,24 +1065,29 @@ function drawOutside(stroke, ui, canvas) {
|
|
|
1052
1065
|
}
|
|
1053
1066
|
}
|
|
1054
1067
|
|
|
1055
|
-
const {getSpread: getSpread, getOuterOf: getOuterOf, getByMove: getByMove, getIntersectData: getIntersectData} = core.BoundsHelper;
|
|
1068
|
+
const {getSpread: getSpread, copyAndSpread: copyAndSpread, toOuterOf: toOuterOf, getOuterOf: getOuterOf, getByMove: getByMove, move: move$1, getIntersectData: getIntersectData} = core.BoundsHelper;
|
|
1069
|
+
|
|
1070
|
+
const tempBounds$1 = {};
|
|
1056
1071
|
|
|
1057
1072
|
function shape(ui, current, options) {
|
|
1058
1073
|
const canvas = current.getSameCanvas();
|
|
1059
|
-
const nowWorld = ui.__nowWorld,
|
|
1060
|
-
|
|
1074
|
+
const currentBounds = current.bounds, nowWorld = ui.__nowWorld, layout = ui.__layout;
|
|
1075
|
+
const nowWorldShapeBounds = ui.__nowWorldShapeBounds || (ui.__nowWorldShapeBounds = {});
|
|
1076
|
+
toOuterOf(layout.strokeSpread ? (copyAndSpread(tempBounds$1, layout.boxBounds, layout.strokeSpread),
|
|
1077
|
+
tempBounds$1) : layout.boxBounds, nowWorld, nowWorldShapeBounds);
|
|
1078
|
+
let bounds, renderBounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
1061
1079
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
1062
|
-
if (currentBounds.includes(
|
|
1080
|
+
if (currentBounds.includes(nowWorldShapeBounds)) {
|
|
1063
1081
|
worldCanvas = canvas;
|
|
1064
|
-
bounds = shapeBounds =
|
|
1082
|
+
bounds = shapeBounds = nowWorldShapeBounds;
|
|
1083
|
+
renderBounds = nowWorld;
|
|
1065
1084
|
} else {
|
|
1066
|
-
const {renderShapeSpread: spread} = ui.__layout;
|
|
1067
1085
|
let worldClipBounds;
|
|
1068
1086
|
if (core.Platform.fullImageShadow) {
|
|
1069
|
-
worldClipBounds =
|
|
1087
|
+
worldClipBounds = nowWorldShapeBounds;
|
|
1070
1088
|
} else {
|
|
1071
|
-
const spreadBounds =
|
|
1072
|
-
worldClipBounds = getIntersectData(spreadBounds,
|
|
1089
|
+
const spreadBounds = layout.renderShapeSpread ? getSpread(currentBounds, core.FourNumberHelper.swapAndScale(layout.renderShapeSpread, scaleX, scaleY)) : currentBounds;
|
|
1090
|
+
worldClipBounds = getIntersectData(spreadBounds, nowWorldShapeBounds);
|
|
1073
1091
|
}
|
|
1074
1092
|
fitMatrix = currentBounds.getFitMatrix(worldClipBounds);
|
|
1075
1093
|
let {a: fitScaleX, d: fitScaleY} = fitMatrix;
|
|
@@ -1079,8 +1097,10 @@ function shape(ui, current, options) {
|
|
|
1079
1097
|
scaleX *= fitScaleX;
|
|
1080
1098
|
scaleY *= fitScaleY;
|
|
1081
1099
|
}
|
|
1082
|
-
shapeBounds = getOuterOf(
|
|
1100
|
+
shapeBounds = getOuterOf(nowWorldShapeBounds, fitMatrix);
|
|
1083
1101
|
bounds = getByMove(shapeBounds, -fitMatrix.e, -fitMatrix.f);
|
|
1102
|
+
renderBounds = getOuterOf(nowWorld, fitMatrix);
|
|
1103
|
+
move$1(renderBounds, -fitMatrix.e, -fitMatrix.f);
|
|
1084
1104
|
const userMatrix = options.matrix;
|
|
1085
1105
|
if (userMatrix) {
|
|
1086
1106
|
matrix = new core.Matrix(fitMatrix);
|
|
@@ -1099,6 +1119,7 @@ function shape(ui, current, options) {
|
|
|
1099
1119
|
matrix: matrix,
|
|
1100
1120
|
fitMatrix: fitMatrix,
|
|
1101
1121
|
bounds: bounds,
|
|
1122
|
+
renderBounds: renderBounds,
|
|
1102
1123
|
worldCanvas: worldCanvas,
|
|
1103
1124
|
shapeBounds: shapeBounds,
|
|
1104
1125
|
scaleX: scaleX,
|
|
@@ -1202,7 +1223,7 @@ const PaintModule = {
|
|
|
1202
1223
|
shape: shape
|
|
1203
1224
|
};
|
|
1204
1225
|
|
|
1205
|
-
let origin = {}, tempMatrix = core.getMatrixData();
|
|
1226
|
+
let origin = {}, tempMatrix$1 = core.getMatrixData();
|
|
1206
1227
|
|
|
1207
1228
|
const {get: get$3, rotateOfOuter: rotateOfOuter$1, translate: translate$1, scaleOfOuter: scaleOfOuter$1, multiplyParent: multiplyParent, scale: scaleHelper, rotate: rotate, skew: skewHelper} = core.MatrixHelper;
|
|
1208
1229
|
|
|
@@ -1217,12 +1238,12 @@ function fillOrFitMode(data, box, x, y, scaleX, scaleY, rotation) {
|
|
|
1217
1238
|
data.transform = transform;
|
|
1218
1239
|
}
|
|
1219
1240
|
|
|
1220
|
-
function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew,
|
|
1241
|
+
function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew, clipScaleX, clipScaleY) {
|
|
1221
1242
|
const transform = get$3();
|
|
1222
1243
|
layout(transform, box, x, y, scaleX, scaleY, rotation, skew);
|
|
1223
|
-
if (
|
|
1224
|
-
tempMatrix.a =
|
|
1225
|
-
multiplyParent(transform, tempMatrix);
|
|
1244
|
+
if (clipScaleX) {
|
|
1245
|
+
tempMatrix$1.a = clipScaleX, tempMatrix$1.d = clipScaleY;
|
|
1246
|
+
multiplyParent(transform, tempMatrix$1);
|
|
1226
1247
|
}
|
|
1227
1248
|
data.transform = transform;
|
|
1228
1249
|
}
|
|
@@ -1323,7 +1344,12 @@ function getPatternData(paint, box, image) {
|
|
|
1323
1344
|
|
|
1324
1345
|
case "normal":
|
|
1325
1346
|
case "clip":
|
|
1326
|
-
if (tempImage.x || tempImage.y || scaleX || clipSize || rotation || skew)
|
|
1347
|
+
if (tempImage.x || tempImage.y || scaleX || clipSize || rotation || skew) {
|
|
1348
|
+
let clipScaleX, clipScaleY;
|
|
1349
|
+
if (clipSize) clipScaleX = box.width / clipSize.width, clipScaleY = box.height / clipSize.height;
|
|
1350
|
+
clipMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation, skew, clipScaleX, clipScaleY);
|
|
1351
|
+
if (clipScaleX) scaleX = scaleX ? scaleX * clipScaleX : scaleX, scaleY = scaleY ? scaleY * clipScaleY : clipScaleY;
|
|
1352
|
+
}
|
|
1327
1353
|
break;
|
|
1328
1354
|
|
|
1329
1355
|
case "repeat":
|
|
@@ -1481,7 +1507,7 @@ function ignoreRender(ui, value) {
|
|
|
1481
1507
|
|
|
1482
1508
|
const {get: get$1, scale: scale, copy: copy$1} = core.MatrixHelper;
|
|
1483
1509
|
|
|
1484
|
-
const {floor: floor, ceil: ceil, max: max, abs: abs} = Math;
|
|
1510
|
+
const {floor: floor, ceil: ceil, max: max$1, abs: abs} = Math;
|
|
1485
1511
|
|
|
1486
1512
|
function createPattern(ui, paint, pixelRatio) {
|
|
1487
1513
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, paint.scaleFixed);
|
|
@@ -1530,8 +1556,8 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1530
1556
|
if (transform || scaleX !== 1 || scaleY !== 1) {
|
|
1531
1557
|
const canvasWidth = width + (xGap || 0);
|
|
1532
1558
|
const canvasHeight = height + (yGap || 0);
|
|
1533
|
-
scaleX /= canvasWidth / max(floor(canvasWidth), 1);
|
|
1534
|
-
scaleY /= canvasHeight / max(floor(canvasHeight), 1);
|
|
1559
|
+
scaleX /= canvasWidth / max$1(floor(canvasWidth), 1);
|
|
1560
|
+
scaleY /= canvasHeight / max$1(floor(canvasHeight), 1);
|
|
1535
1561
|
if (!imageMatrix) {
|
|
1536
1562
|
imageMatrix = get$1();
|
|
1537
1563
|
if (transform) copy$1(imageMatrix, transform);
|
|
@@ -1557,17 +1583,15 @@ function checkImage(ui, canvas, paint, allowDraw) {
|
|
|
1557
1583
|
if (allowDraw) {
|
|
1558
1584
|
if (data.repeat) {
|
|
1559
1585
|
allowDraw = false;
|
|
1560
|
-
} else {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
height *= data.scaleY;
|
|
1568
|
-
}
|
|
1569
|
-
allowDraw = width * height > core.Platform.image.maxCacheSize;
|
|
1586
|
+
} else if (!(paint.changeful || core.Platform.name === "miniapp" && core.ResizeEvent.isResizing(ui) || draw.Export.running)) {
|
|
1587
|
+
let {width: width, height: height} = data;
|
|
1588
|
+
width *= scaleX * pixelRatio;
|
|
1589
|
+
height *= scaleY * pixelRatio;
|
|
1590
|
+
if (data.scaleX) {
|
|
1591
|
+
width *= data.scaleX;
|
|
1592
|
+
height *= data.scaleY;
|
|
1570
1593
|
}
|
|
1594
|
+
allowDraw = width * height > core.Platform.image.maxCacheSize;
|
|
1571
1595
|
}
|
|
1572
1596
|
}
|
|
1573
1597
|
if (allowDraw) {
|
|
@@ -1747,20 +1771,20 @@ const PaintGradientModule = {
|
|
|
1747
1771
|
getTransform: getTransform
|
|
1748
1772
|
};
|
|
1749
1773
|
|
|
1750
|
-
const {copy: copy, toOffsetOutBounds: toOffsetOutBounds$1} = core.BoundsHelper;
|
|
1774
|
+
const {copy: copy, move: move, toOffsetOutBounds: toOffsetOutBounds$1} = core.BoundsHelper, {max: max} = Math;
|
|
1751
1775
|
|
|
1752
|
-
const tempBounds = {};
|
|
1776
|
+
const tempBounds = {}, tempMatrix = new core.Matrix;
|
|
1753
1777
|
|
|
1754
1778
|
const offsetOutBounds$1 = {};
|
|
1755
1779
|
|
|
1756
1780
|
function shadow(ui, current, shape) {
|
|
1757
|
-
let copyBounds,
|
|
1758
|
-
const {__nowWorld: nowWorld
|
|
1781
|
+
let copyBounds, transform;
|
|
1782
|
+
const {__nowWorld: nowWorld} = ui;
|
|
1759
1783
|
const {shadow: shadow} = ui.__;
|
|
1760
|
-
const {worldCanvas: worldCanvas, bounds: bounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
1784
|
+
const {worldCanvas: worldCanvas, bounds: bounds, renderBounds: renderBounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
1761
1785
|
const other = current.getSameCanvas();
|
|
1762
1786
|
const end = shadow.length - 1;
|
|
1763
|
-
toOffsetOutBounds$1(bounds, offsetOutBounds$1);
|
|
1787
|
+
toOffsetOutBounds$1(bounds, offsetOutBounds$1, renderBounds);
|
|
1764
1788
|
shadow.forEach((item, index) => {
|
|
1765
1789
|
let otherScale = 1;
|
|
1766
1790
|
if (item.scaleFixed) {
|
|
@@ -1768,54 +1792,61 @@ function shadow(ui, current, shape) {
|
|
|
1768
1792
|
if (sx > 1) otherScale = 1 / sx;
|
|
1769
1793
|
}
|
|
1770
1794
|
other.setWorldShadow(offsetOutBounds$1.offsetX + item.x * scaleX * otherScale, offsetOutBounds$1.offsetY + item.y * scaleY * otherScale, item.blur * scaleX * otherScale, draw.ColorConvert.string(item.color));
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1795
|
+
transform = getShadowTransform(ui, other, shape, item, offsetOutBounds$1, otherScale);
|
|
1796
|
+
if (transform) other.setTransform(transform);
|
|
1797
|
+
drawWorldShadow(other, offsetOutBounds$1, shape);
|
|
1798
|
+
if (transform) other.resetTransform();
|
|
1799
|
+
copyBounds = renderBounds;
|
|
1774
1800
|
if (item.box) {
|
|
1775
1801
|
other.restore();
|
|
1776
1802
|
other.save();
|
|
1777
1803
|
if (worldCanvas) {
|
|
1778
|
-
other.copyWorld(other,
|
|
1804
|
+
other.copyWorld(other, renderBounds, nowWorld, "copy");
|
|
1779
1805
|
copyBounds = nowWorld;
|
|
1780
1806
|
}
|
|
1781
1807
|
worldCanvas ? other.copyWorld(worldCanvas, nowWorld, nowWorld, "destination-out") : other.copyWorld(shape.canvas, shapeBounds, bounds, "destination-out");
|
|
1782
1808
|
}
|
|
1783
|
-
|
|
1809
|
+
core.LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
|
|
1784
1810
|
if (end && index < end) other.clearWorld(copyBounds);
|
|
1785
1811
|
});
|
|
1786
1812
|
other.recycle(copyBounds);
|
|
1787
1813
|
}
|
|
1788
1814
|
|
|
1789
|
-
function
|
|
1790
|
-
let
|
|
1791
|
-
shadow.forEach(item =>
|
|
1792
|
-
|
|
1815
|
+
function getShadowRenderSpread(_ui, shadow) {
|
|
1816
|
+
let top = 0, right = 0, bottom = 0, left = 0, x, y, spread, blur;
|
|
1817
|
+
shadow.forEach(item => {
|
|
1818
|
+
x = item.x || 0, y = item.y || 0, spread = item.spread || 0, blur = (item.blur || 0) * 1.5;
|
|
1819
|
+
top = max(top, spread + blur - y);
|
|
1820
|
+
right = max(right, spread + blur + x);
|
|
1821
|
+
bottom = max(bottom, spread + blur + y);
|
|
1822
|
+
left = max(left, spread + blur - x);
|
|
1823
|
+
});
|
|
1824
|
+
return top === right && right === bottom && bottom === left ? top : [ top, right, bottom, left ];
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
|
|
1828
|
+
if (shadow.spread) {
|
|
1829
|
+
const spreadScale = 1 + shadow.spread * 2 / ui.__layout.strokeBounds.width * otherScale * (isInnerShaodw ? -1 : 1);
|
|
1830
|
+
tempMatrix.set().scaleOfOuter({
|
|
1831
|
+
x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
|
|
1832
|
+
y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
|
|
1833
|
+
}, spreadScale);
|
|
1834
|
+
return tempMatrix;
|
|
1835
|
+
}
|
|
1836
|
+
return undefined;
|
|
1793
1837
|
}
|
|
1794
1838
|
|
|
1795
|
-
function drawWorldShadow(canvas, outBounds,
|
|
1796
|
-
const {
|
|
1839
|
+
function drawWorldShadow(canvas, outBounds, shape) {
|
|
1840
|
+
const {shapeBounds: shapeBounds} = shape;
|
|
1841
|
+
let from, to;
|
|
1797
1842
|
if (core.Platform.fullImageShadow) {
|
|
1798
1843
|
copy(tempBounds, canvas.bounds);
|
|
1799
|
-
tempBounds.x
|
|
1800
|
-
|
|
1801
|
-
if (spreadScale) {
|
|
1802
|
-
const {fitMatrix: fitMatrix} = shape;
|
|
1803
|
-
tempBounds.x -= (bounds.x + (fitMatrix ? fitMatrix.e : 0) + bounds.width / 2) * (spreadScale - 1);
|
|
1804
|
-
tempBounds.y -= (bounds.y + (fitMatrix ? fitMatrix.f : 0) + bounds.height / 2) * (spreadScale - 1);
|
|
1805
|
-
tempBounds.width *= spreadScale;
|
|
1806
|
-
tempBounds.height *= spreadScale;
|
|
1807
|
-
}
|
|
1808
|
-
canvas.copyWorld(shape.canvas, canvas.bounds, tempBounds);
|
|
1844
|
+
move(tempBounds, outBounds.x - shapeBounds.x, outBounds.y - shapeBounds.y);
|
|
1845
|
+
from = canvas.bounds, to = tempBounds;
|
|
1809
1846
|
} else {
|
|
1810
|
-
|
|
1811
|
-
copy(tempBounds, outBounds);
|
|
1812
|
-
tempBounds.x -= outBounds.width / 2 * (spreadScale - 1);
|
|
1813
|
-
tempBounds.y -= outBounds.height / 2 * (spreadScale - 1);
|
|
1814
|
-
tempBounds.width *= spreadScale;
|
|
1815
|
-
tempBounds.height *= spreadScale;
|
|
1816
|
-
}
|
|
1817
|
-
canvas.copyWorld(shape.canvas, shapeBounds, spreadScale ? tempBounds : outBounds);
|
|
1847
|
+
from = shapeBounds, to = outBounds;
|
|
1818
1848
|
}
|
|
1849
|
+
canvas.copyWorld(shape.canvas, from, to);
|
|
1819
1850
|
}
|
|
1820
1851
|
|
|
1821
1852
|
const {toOffsetOutBounds: toOffsetOutBounds} = core.BoundsHelper;
|
|
@@ -1823,13 +1854,13 @@ const {toOffsetOutBounds: toOffsetOutBounds} = core.BoundsHelper;
|
|
|
1823
1854
|
const offsetOutBounds = {};
|
|
1824
1855
|
|
|
1825
1856
|
function innerShadow(ui, current, shape) {
|
|
1826
|
-
let copyBounds,
|
|
1827
|
-
const {__nowWorld: nowWorld
|
|
1857
|
+
let copyBounds, transform;
|
|
1858
|
+
const {__nowWorld: nowWorld} = ui;
|
|
1828
1859
|
const {innerShadow: innerShadow} = ui.__;
|
|
1829
|
-
const {worldCanvas: worldCanvas, bounds: bounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
1860
|
+
const {worldCanvas: worldCanvas, bounds: bounds, renderBounds: renderBounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
1830
1861
|
const other = current.getSameCanvas();
|
|
1831
1862
|
const end = innerShadow.length - 1;
|
|
1832
|
-
toOffsetOutBounds(bounds, offsetOutBounds);
|
|
1863
|
+
toOffsetOutBounds(bounds, offsetOutBounds, renderBounds);
|
|
1833
1864
|
innerShadow.forEach((item, index) => {
|
|
1834
1865
|
let otherScale = 1;
|
|
1835
1866
|
if (item.scaleFixed) {
|
|
@@ -1838,16 +1869,17 @@ function innerShadow(ui, current, shape) {
|
|
|
1838
1869
|
}
|
|
1839
1870
|
other.save();
|
|
1840
1871
|
other.setWorldShadow(offsetOutBounds.offsetX + item.x * scaleX * otherScale, offsetOutBounds.offsetY + item.y * scaleY * otherScale, item.blur * scaleX * otherScale);
|
|
1841
|
-
|
|
1842
|
-
|
|
1872
|
+
transform = getShadowTransform(ui, other, shape, item, offsetOutBounds, otherScale, true);
|
|
1873
|
+
if (transform) other.setTransform(transform);
|
|
1874
|
+
drawWorldShadow(other, offsetOutBounds, shape);
|
|
1843
1875
|
other.restore();
|
|
1844
1876
|
if (worldCanvas) {
|
|
1845
|
-
other.copyWorld(other,
|
|
1877
|
+
other.copyWorld(other, renderBounds, nowWorld, "copy");
|
|
1846
1878
|
other.copyWorld(worldCanvas, nowWorld, nowWorld, "source-out");
|
|
1847
1879
|
copyBounds = nowWorld;
|
|
1848
1880
|
} else {
|
|
1849
1881
|
other.copyWorld(shape.canvas, shapeBounds, bounds, "source-out");
|
|
1850
|
-
copyBounds =
|
|
1882
|
+
copyBounds = renderBounds;
|
|
1851
1883
|
}
|
|
1852
1884
|
other.fillWorld(copyBounds, draw.ColorConvert.string(item.color), "source-in");
|
|
1853
1885
|
core.LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
|
|
@@ -1856,6 +1888,8 @@ function innerShadow(ui, current, shape) {
|
|
|
1856
1888
|
other.recycle(copyBounds);
|
|
1857
1889
|
}
|
|
1858
1890
|
|
|
1891
|
+
const getInnerShadowSpread = getShadowRenderSpread;
|
|
1892
|
+
|
|
1859
1893
|
function blur(ui, current, origin) {
|
|
1860
1894
|
const {blur: blur} = ui.__;
|
|
1861
1895
|
origin.setWorldBlur(blur * ui.__nowWorld.a);
|
|
@@ -1870,10 +1904,12 @@ const EffectModule = {
|
|
|
1870
1904
|
innerShadow: innerShadow,
|
|
1871
1905
|
blur: blur,
|
|
1872
1906
|
backgroundBlur: backgroundBlur,
|
|
1873
|
-
|
|
1907
|
+
getShadowRenderSpread: getShadowRenderSpread,
|
|
1908
|
+
getShadowTransform: getShadowTransform,
|
|
1874
1909
|
isTransformShadow(_shadow) {
|
|
1875
1910
|
return undefined;
|
|
1876
|
-
}
|
|
1911
|
+
},
|
|
1912
|
+
getInnerShadowSpread: getInnerShadowSpread
|
|
1877
1913
|
};
|
|
1878
1914
|
|
|
1879
1915
|
const {excludeRenderBounds: excludeRenderBounds} = core.LeafBoundsHelper;
|
|
@@ -1890,6 +1926,7 @@ draw.Group.prototype.__renderMask = function(canvas, options) {
|
|
|
1890
1926
|
maskEnd(this, currentMask, canvas, contentCanvas, maskCanvas, maskOpacity, undefined, true);
|
|
1891
1927
|
maskCanvas = contentCanvas = null;
|
|
1892
1928
|
}
|
|
1929
|
+
if (mask === "clipping" || mask === "clipping-path") excludeRenderBounds(child, options) || child.__render(canvas, options);
|
|
1893
1930
|
maskOpacity = child.__.opacity;
|
|
1894
1931
|
usedGrayscaleAlpha = false;
|
|
1895
1932
|
if (mask === "path" || mask === "clipping-path") {
|
|
@@ -1907,7 +1944,6 @@ draw.Group.prototype.__renderMask = function(canvas, options) {
|
|
|
1907
1944
|
if (!contentCanvas) contentCanvas = getCanvas(canvas);
|
|
1908
1945
|
child.__render(maskCanvas, options);
|
|
1909
1946
|
}
|
|
1910
|
-
if (mask === "clipping" || mask === "clipping-path") excludeRenderBounds(child, options) || child.__render(canvas, options);
|
|
1911
1947
|
continue;
|
|
1912
1948
|
}
|
|
1913
1949
|
const childBlendMode = maskOpacity === 1 && child.__.__blendMode;
|
|
@@ -2605,14 +2641,10 @@ const ExportModule = {
|
|
|
2605
2641
|
renderOptions.bounds = canvas.bounds;
|
|
2606
2642
|
}
|
|
2607
2643
|
canvas.save();
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
leaf.fill = oldFill;
|
|
2613
|
-
} else {
|
|
2614
|
-
leaf.__render(canvas, renderOptions);
|
|
2615
|
-
}
|
|
2644
|
+
const igroneFill = isFrame && !draw.isUndefined(fill), oldFill = leaf.get("fill");
|
|
2645
|
+
if (igroneFill) leaf.fill = "";
|
|
2646
|
+
draw.Platform.render(leaf, canvas, renderOptions);
|
|
2647
|
+
if (igroneFill) leaf.fill = oldFill;
|
|
2616
2648
|
canvas.restore();
|
|
2617
2649
|
if (sliceLeaf) sliceLeaf.__updateWorldOpacity();
|
|
2618
2650
|
if (trim) {
|