@leafer-ui/miniapp 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/miniapp.cjs +116 -80
- package/dist/miniapp.esm.js +118 -82
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +289 -187
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/miniapp.cjs
CHANGED
|
@@ -582,6 +582,7 @@ class Renderer {
|
|
|
582
582
|
usePartRender: true,
|
|
583
583
|
maxFPS: 120
|
|
584
584
|
};
|
|
585
|
+
this.frames = [];
|
|
585
586
|
this.target = target;
|
|
586
587
|
this.canvas = canvas;
|
|
587
588
|
if (userConfig) this.config = core.DataHelper.default(userConfig, this.config);
|
|
@@ -711,7 +712,7 @@ class Renderer {
|
|
|
711
712
|
};
|
|
712
713
|
if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
|
|
713
714
|
if (core.Debug.showRepaint) core.Debug.drawRepaint(canvas, bounds);
|
|
714
|
-
this.target
|
|
715
|
+
core.Platform.render(this.target, canvas, options);
|
|
715
716
|
this.renderBounds = realBounds = realBounds || bounds;
|
|
716
717
|
this.renderOptions = options;
|
|
717
718
|
this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
|
|
@@ -734,12 +735,15 @@ class Renderer {
|
|
|
734
735
|
const target = this.target;
|
|
735
736
|
if (this.requestTime || !target) return;
|
|
736
737
|
if (target.parentApp) return target.parentApp.requestRender(false);
|
|
737
|
-
|
|
738
|
+
this.requestTime = this.frameTime || Date.now();
|
|
738
739
|
const render = () => {
|
|
739
|
-
const nowFPS = 1e3 / (Date.now() - requestTime);
|
|
740
|
+
const nowFPS = 1e3 / ((this.frameTime = Date.now()) - this.requestTime);
|
|
740
741
|
const {maxFPS: maxFPS} = this.config;
|
|
741
|
-
if (maxFPS && nowFPS > maxFPS
|
|
742
|
-
|
|
742
|
+
if (maxFPS && nowFPS > maxFPS) return core.Platform.requestRender(render);
|
|
743
|
+
const {frames: frames} = this;
|
|
744
|
+
if (frames.length > 30) frames.shift();
|
|
745
|
+
frames.push(nowFPS);
|
|
746
|
+
this.FPS = Math.round(frames.reduce((a, b) => a + b, 0) / frames.length);
|
|
743
747
|
this.requestTime = 0;
|
|
744
748
|
this.checkRender();
|
|
745
749
|
};
|
|
@@ -987,6 +991,15 @@ Object.assign(core.Creator, {
|
|
|
987
991
|
|
|
988
992
|
core.Platform.layout = Layouter.fullLayout;
|
|
989
993
|
|
|
994
|
+
core.Platform.render = function(target, canvas, options) {
|
|
995
|
+
const topOptions = Object.assign(Object.assign({}, options), {
|
|
996
|
+
topRendering: true
|
|
997
|
+
});
|
|
998
|
+
options.topList = new core.LeafList;
|
|
999
|
+
target.__render(canvas, options);
|
|
1000
|
+
if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
|
|
1001
|
+
};
|
|
1002
|
+
|
|
990
1003
|
const PointerEventHelper = {
|
|
991
1004
|
convertTouch(e, local) {
|
|
992
1005
|
const touch = PointerEventHelper.getTouch(e);
|
|
@@ -1292,24 +1305,29 @@ function drawOutside(stroke, ui, canvas) {
|
|
|
1292
1305
|
}
|
|
1293
1306
|
}
|
|
1294
1307
|
|
|
1295
|
-
const {getSpread: getSpread, getOuterOf: getOuterOf, getByMove: getByMove, getIntersectData: getIntersectData} = core.BoundsHelper;
|
|
1308
|
+
const {getSpread: getSpread, copyAndSpread: copyAndSpread, toOuterOf: toOuterOf, getOuterOf: getOuterOf, getByMove: getByMove, move: move$1, getIntersectData: getIntersectData} = core.BoundsHelper;
|
|
1309
|
+
|
|
1310
|
+
const tempBounds$1 = {};
|
|
1296
1311
|
|
|
1297
1312
|
function shape(ui, current, options) {
|
|
1298
1313
|
const canvas = current.getSameCanvas();
|
|
1299
|
-
const nowWorld = ui.__nowWorld,
|
|
1300
|
-
|
|
1314
|
+
const currentBounds = current.bounds, nowWorld = ui.__nowWorld, layout = ui.__layout;
|
|
1315
|
+
const nowWorldShapeBounds = ui.__nowWorldShapeBounds || (ui.__nowWorldShapeBounds = {});
|
|
1316
|
+
toOuterOf(layout.strokeSpread ? (copyAndSpread(tempBounds$1, layout.boxBounds, layout.strokeSpread),
|
|
1317
|
+
tempBounds$1) : layout.boxBounds, nowWorld, nowWorldShapeBounds);
|
|
1318
|
+
let bounds, renderBounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
1301
1319
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
1302
|
-
if (currentBounds.includes(
|
|
1320
|
+
if (currentBounds.includes(nowWorldShapeBounds)) {
|
|
1303
1321
|
worldCanvas = canvas;
|
|
1304
|
-
bounds = shapeBounds =
|
|
1322
|
+
bounds = shapeBounds = nowWorldShapeBounds;
|
|
1323
|
+
renderBounds = nowWorld;
|
|
1305
1324
|
} else {
|
|
1306
|
-
const {renderShapeSpread: spread} = ui.__layout;
|
|
1307
1325
|
let worldClipBounds;
|
|
1308
1326
|
if (core.Platform.fullImageShadow) {
|
|
1309
|
-
worldClipBounds =
|
|
1327
|
+
worldClipBounds = nowWorldShapeBounds;
|
|
1310
1328
|
} else {
|
|
1311
|
-
const spreadBounds =
|
|
1312
|
-
worldClipBounds = getIntersectData(spreadBounds,
|
|
1329
|
+
const spreadBounds = layout.renderShapeSpread ? getSpread(currentBounds, core.FourNumberHelper.swapAndScale(layout.renderShapeSpread, scaleX, scaleY)) : currentBounds;
|
|
1330
|
+
worldClipBounds = getIntersectData(spreadBounds, nowWorldShapeBounds);
|
|
1313
1331
|
}
|
|
1314
1332
|
fitMatrix = currentBounds.getFitMatrix(worldClipBounds);
|
|
1315
1333
|
let {a: fitScaleX, d: fitScaleY} = fitMatrix;
|
|
@@ -1319,8 +1337,10 @@ function shape(ui, current, options) {
|
|
|
1319
1337
|
scaleX *= fitScaleX;
|
|
1320
1338
|
scaleY *= fitScaleY;
|
|
1321
1339
|
}
|
|
1322
|
-
shapeBounds = getOuterOf(
|
|
1340
|
+
shapeBounds = getOuterOf(nowWorldShapeBounds, fitMatrix);
|
|
1323
1341
|
bounds = getByMove(shapeBounds, -fitMatrix.e, -fitMatrix.f);
|
|
1342
|
+
renderBounds = getOuterOf(nowWorld, fitMatrix);
|
|
1343
|
+
move$1(renderBounds, -fitMatrix.e, -fitMatrix.f);
|
|
1324
1344
|
const userMatrix = options.matrix;
|
|
1325
1345
|
if (userMatrix) {
|
|
1326
1346
|
matrix = new core.Matrix(fitMatrix);
|
|
@@ -1339,6 +1359,7 @@ function shape(ui, current, options) {
|
|
|
1339
1359
|
matrix: matrix,
|
|
1340
1360
|
fitMatrix: fitMatrix,
|
|
1341
1361
|
bounds: bounds,
|
|
1362
|
+
renderBounds: renderBounds,
|
|
1342
1363
|
worldCanvas: worldCanvas,
|
|
1343
1364
|
shapeBounds: shapeBounds,
|
|
1344
1365
|
scaleX: scaleX,
|
|
@@ -1442,7 +1463,7 @@ const PaintModule = {
|
|
|
1442
1463
|
shape: shape
|
|
1443
1464
|
};
|
|
1444
1465
|
|
|
1445
|
-
let origin = {}, tempMatrix = core.getMatrixData();
|
|
1466
|
+
let origin = {}, tempMatrix$1 = core.getMatrixData();
|
|
1446
1467
|
|
|
1447
1468
|
const {get: get$3, rotateOfOuter: rotateOfOuter$1, translate: translate$1, scaleOfOuter: scaleOfOuter$1, multiplyParent: multiplyParent, scale: scaleHelper, rotate: rotate, skew: skewHelper} = core.MatrixHelper;
|
|
1448
1469
|
|
|
@@ -1457,12 +1478,12 @@ function fillOrFitMode(data, box, x, y, scaleX, scaleY, rotation) {
|
|
|
1457
1478
|
data.transform = transform;
|
|
1458
1479
|
}
|
|
1459
1480
|
|
|
1460
|
-
function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew,
|
|
1481
|
+
function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew, clipScaleX, clipScaleY) {
|
|
1461
1482
|
const transform = get$3();
|
|
1462
1483
|
layout(transform, box, x, y, scaleX, scaleY, rotation, skew);
|
|
1463
|
-
if (
|
|
1464
|
-
tempMatrix.a =
|
|
1465
|
-
multiplyParent(transform, tempMatrix);
|
|
1484
|
+
if (clipScaleX) {
|
|
1485
|
+
tempMatrix$1.a = clipScaleX, tempMatrix$1.d = clipScaleY;
|
|
1486
|
+
multiplyParent(transform, tempMatrix$1);
|
|
1466
1487
|
}
|
|
1467
1488
|
data.transform = transform;
|
|
1468
1489
|
}
|
|
@@ -1563,7 +1584,12 @@ function getPatternData(paint, box, image) {
|
|
|
1563
1584
|
|
|
1564
1585
|
case "normal":
|
|
1565
1586
|
case "clip":
|
|
1566
|
-
if (tempImage.x || tempImage.y || scaleX || clipSize || rotation || skew)
|
|
1587
|
+
if (tempImage.x || tempImage.y || scaleX || clipSize || rotation || skew) {
|
|
1588
|
+
let clipScaleX, clipScaleY;
|
|
1589
|
+
if (clipSize) clipScaleX = box.width / clipSize.width, clipScaleY = box.height / clipSize.height;
|
|
1590
|
+
clipMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation, skew, clipScaleX, clipScaleY);
|
|
1591
|
+
if (clipScaleX) scaleX = scaleX ? scaleX * clipScaleX : scaleX, scaleY = scaleY ? scaleY * clipScaleY : clipScaleY;
|
|
1592
|
+
}
|
|
1567
1593
|
break;
|
|
1568
1594
|
|
|
1569
1595
|
case "repeat":
|
|
@@ -1721,7 +1747,7 @@ function ignoreRender(ui, value) {
|
|
|
1721
1747
|
|
|
1722
1748
|
const {get: get$1, scale: scale, copy: copy$1} = core.MatrixHelper;
|
|
1723
1749
|
|
|
1724
|
-
const {floor: floor, ceil: ceil, max: max, abs: abs} = Math;
|
|
1750
|
+
const {floor: floor, ceil: ceil, max: max$1, abs: abs} = Math;
|
|
1725
1751
|
|
|
1726
1752
|
function createPattern(ui, paint, pixelRatio) {
|
|
1727
1753
|
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, paint.scaleFixed);
|
|
@@ -1770,8 +1796,8 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
1770
1796
|
if (transform || scaleX !== 1 || scaleY !== 1) {
|
|
1771
1797
|
const canvasWidth = width + (xGap || 0);
|
|
1772
1798
|
const canvasHeight = height + (yGap || 0);
|
|
1773
|
-
scaleX /= canvasWidth / max(floor(canvasWidth), 1);
|
|
1774
|
-
scaleY /= canvasHeight / max(floor(canvasHeight), 1);
|
|
1799
|
+
scaleX /= canvasWidth / max$1(floor(canvasWidth), 1);
|
|
1800
|
+
scaleY /= canvasHeight / max$1(floor(canvasHeight), 1);
|
|
1775
1801
|
if (!imageMatrix) {
|
|
1776
1802
|
imageMatrix = get$1();
|
|
1777
1803
|
if (transform) copy$1(imageMatrix, transform);
|
|
@@ -1830,17 +1856,15 @@ function checkImage(ui, canvas, paint, allowDraw) {
|
|
|
1830
1856
|
if (allowDraw) {
|
|
1831
1857
|
if (data.repeat) {
|
|
1832
1858
|
allowDraw = false;
|
|
1833
|
-
} else {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
height *= data.scaleY;
|
|
1841
|
-
}
|
|
1842
|
-
allowDraw = width * height > core.Platform.image.maxCacheSize;
|
|
1859
|
+
} else if (!(paint.changeful || core.Platform.name === "miniapp" && core.ResizeEvent.isResizing(ui) || draw.Export.running)) {
|
|
1860
|
+
let {width: width, height: height} = data;
|
|
1861
|
+
width *= scaleX * pixelRatio;
|
|
1862
|
+
height *= scaleY * pixelRatio;
|
|
1863
|
+
if (data.scaleX) {
|
|
1864
|
+
width *= data.scaleX;
|
|
1865
|
+
height *= data.scaleY;
|
|
1843
1866
|
}
|
|
1867
|
+
allowDraw = width * height > core.Platform.image.maxCacheSize;
|
|
1844
1868
|
}
|
|
1845
1869
|
}
|
|
1846
1870
|
if (allowDraw) {
|
|
@@ -2020,20 +2044,20 @@ const PaintGradientModule = {
|
|
|
2020
2044
|
getTransform: getTransform
|
|
2021
2045
|
};
|
|
2022
2046
|
|
|
2023
|
-
const {copy: copy, toOffsetOutBounds: toOffsetOutBounds$1} = core.BoundsHelper;
|
|
2047
|
+
const {copy: copy, move: move, toOffsetOutBounds: toOffsetOutBounds$1} = core.BoundsHelper, {max: max} = Math;
|
|
2024
2048
|
|
|
2025
|
-
const tempBounds = {};
|
|
2049
|
+
const tempBounds = {}, tempMatrix = new core.Matrix;
|
|
2026
2050
|
|
|
2027
2051
|
const offsetOutBounds$1 = {};
|
|
2028
2052
|
|
|
2029
2053
|
function shadow(ui, current, shape) {
|
|
2030
|
-
let copyBounds,
|
|
2031
|
-
const {__nowWorld: nowWorld
|
|
2054
|
+
let copyBounds, transform;
|
|
2055
|
+
const {__nowWorld: nowWorld} = ui;
|
|
2032
2056
|
const {shadow: shadow} = ui.__;
|
|
2033
|
-
const {worldCanvas: worldCanvas, bounds: bounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
2057
|
+
const {worldCanvas: worldCanvas, bounds: bounds, renderBounds: renderBounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
2034
2058
|
const other = current.getSameCanvas();
|
|
2035
2059
|
const end = shadow.length - 1;
|
|
2036
|
-
toOffsetOutBounds$1(bounds, offsetOutBounds$1);
|
|
2060
|
+
toOffsetOutBounds$1(bounds, offsetOutBounds$1, renderBounds);
|
|
2037
2061
|
shadow.forEach((item, index) => {
|
|
2038
2062
|
let otherScale = 1;
|
|
2039
2063
|
if (item.scaleFixed) {
|
|
@@ -2041,54 +2065,61 @@ function shadow(ui, current, shape) {
|
|
|
2041
2065
|
if (sx > 1) otherScale = 1 / sx;
|
|
2042
2066
|
}
|
|
2043
2067
|
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));
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2068
|
+
transform = getShadowTransform(ui, other, shape, item, offsetOutBounds$1, otherScale);
|
|
2069
|
+
if (transform) other.setTransform(transform);
|
|
2070
|
+
drawWorldShadow(other, offsetOutBounds$1, shape);
|
|
2071
|
+
if (transform) other.resetTransform();
|
|
2072
|
+
copyBounds = renderBounds;
|
|
2047
2073
|
if (item.box) {
|
|
2048
2074
|
other.restore();
|
|
2049
2075
|
other.save();
|
|
2050
2076
|
if (worldCanvas) {
|
|
2051
|
-
other.copyWorld(other,
|
|
2077
|
+
other.copyWorld(other, renderBounds, nowWorld, "copy");
|
|
2052
2078
|
copyBounds = nowWorld;
|
|
2053
2079
|
}
|
|
2054
2080
|
worldCanvas ? other.copyWorld(worldCanvas, nowWorld, nowWorld, "destination-out") : other.copyWorld(shape.canvas, shapeBounds, bounds, "destination-out");
|
|
2055
2081
|
}
|
|
2056
|
-
|
|
2082
|
+
core.LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
|
|
2057
2083
|
if (end && index < end) other.clearWorld(copyBounds);
|
|
2058
2084
|
});
|
|
2059
2085
|
other.recycle(copyBounds);
|
|
2060
2086
|
}
|
|
2061
2087
|
|
|
2062
|
-
function
|
|
2063
|
-
let
|
|
2064
|
-
shadow.forEach(item =>
|
|
2065
|
-
|
|
2088
|
+
function getShadowRenderSpread(_ui, shadow) {
|
|
2089
|
+
let top = 0, right = 0, bottom = 0, left = 0, x, y, spread, blur;
|
|
2090
|
+
shadow.forEach(item => {
|
|
2091
|
+
x = item.x || 0, y = item.y || 0, spread = item.spread || 0, blur = (item.blur || 0) * 1.5;
|
|
2092
|
+
top = max(top, spread + blur - y);
|
|
2093
|
+
right = max(right, spread + blur + x);
|
|
2094
|
+
bottom = max(bottom, spread + blur + y);
|
|
2095
|
+
left = max(left, spread + blur - x);
|
|
2096
|
+
});
|
|
2097
|
+
return top === right && right === bottom && bottom === left ? top : [ top, right, bottom, left ];
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
|
|
2101
|
+
if (shadow.spread) {
|
|
2102
|
+
const spreadScale = 1 + shadow.spread * 2 / ui.__layout.strokeBounds.width * otherScale * (isInnerShaodw ? -1 : 1);
|
|
2103
|
+
tempMatrix.set().scaleOfOuter({
|
|
2104
|
+
x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
|
|
2105
|
+
y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
|
|
2106
|
+
}, spreadScale);
|
|
2107
|
+
return tempMatrix;
|
|
2108
|
+
}
|
|
2109
|
+
return undefined;
|
|
2066
2110
|
}
|
|
2067
2111
|
|
|
2068
|
-
function drawWorldShadow(canvas, outBounds,
|
|
2069
|
-
const {
|
|
2112
|
+
function drawWorldShadow(canvas, outBounds, shape) {
|
|
2113
|
+
const {shapeBounds: shapeBounds} = shape;
|
|
2114
|
+
let from, to;
|
|
2070
2115
|
if (core.Platform.fullImageShadow) {
|
|
2071
2116
|
copy(tempBounds, canvas.bounds);
|
|
2072
|
-
tempBounds.x
|
|
2073
|
-
|
|
2074
|
-
if (spreadScale) {
|
|
2075
|
-
const {fitMatrix: fitMatrix} = shape;
|
|
2076
|
-
tempBounds.x -= (bounds.x + (fitMatrix ? fitMatrix.e : 0) + bounds.width / 2) * (spreadScale - 1);
|
|
2077
|
-
tempBounds.y -= (bounds.y + (fitMatrix ? fitMatrix.f : 0) + bounds.height / 2) * (spreadScale - 1);
|
|
2078
|
-
tempBounds.width *= spreadScale;
|
|
2079
|
-
tempBounds.height *= spreadScale;
|
|
2080
|
-
}
|
|
2081
|
-
canvas.copyWorld(shape.canvas, canvas.bounds, tempBounds);
|
|
2117
|
+
move(tempBounds, outBounds.x - shapeBounds.x, outBounds.y - shapeBounds.y);
|
|
2118
|
+
from = canvas.bounds, to = tempBounds;
|
|
2082
2119
|
} else {
|
|
2083
|
-
|
|
2084
|
-
copy(tempBounds, outBounds);
|
|
2085
|
-
tempBounds.x -= outBounds.width / 2 * (spreadScale - 1);
|
|
2086
|
-
tempBounds.y -= outBounds.height / 2 * (spreadScale - 1);
|
|
2087
|
-
tempBounds.width *= spreadScale;
|
|
2088
|
-
tempBounds.height *= spreadScale;
|
|
2089
|
-
}
|
|
2090
|
-
canvas.copyWorld(shape.canvas, shapeBounds, spreadScale ? tempBounds : outBounds);
|
|
2120
|
+
from = shapeBounds, to = outBounds;
|
|
2091
2121
|
}
|
|
2122
|
+
canvas.copyWorld(shape.canvas, from, to);
|
|
2092
2123
|
}
|
|
2093
2124
|
|
|
2094
2125
|
const {toOffsetOutBounds: toOffsetOutBounds} = core.BoundsHelper;
|
|
@@ -2096,13 +2127,13 @@ const {toOffsetOutBounds: toOffsetOutBounds} = core.BoundsHelper;
|
|
|
2096
2127
|
const offsetOutBounds = {};
|
|
2097
2128
|
|
|
2098
2129
|
function innerShadow(ui, current, shape) {
|
|
2099
|
-
let copyBounds,
|
|
2100
|
-
const {__nowWorld: nowWorld
|
|
2130
|
+
let copyBounds, transform;
|
|
2131
|
+
const {__nowWorld: nowWorld} = ui;
|
|
2101
2132
|
const {innerShadow: innerShadow} = ui.__;
|
|
2102
|
-
const {worldCanvas: worldCanvas, bounds: bounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
2133
|
+
const {worldCanvas: worldCanvas, bounds: bounds, renderBounds: renderBounds, shapeBounds: shapeBounds, scaleX: scaleX, scaleY: scaleY} = shape;
|
|
2103
2134
|
const other = current.getSameCanvas();
|
|
2104
2135
|
const end = innerShadow.length - 1;
|
|
2105
|
-
toOffsetOutBounds(bounds, offsetOutBounds);
|
|
2136
|
+
toOffsetOutBounds(bounds, offsetOutBounds, renderBounds);
|
|
2106
2137
|
innerShadow.forEach((item, index) => {
|
|
2107
2138
|
let otherScale = 1;
|
|
2108
2139
|
if (item.scaleFixed) {
|
|
@@ -2111,16 +2142,17 @@ function innerShadow(ui, current, shape) {
|
|
|
2111
2142
|
}
|
|
2112
2143
|
other.save();
|
|
2113
2144
|
other.setWorldShadow(offsetOutBounds.offsetX + item.x * scaleX * otherScale, offsetOutBounds.offsetY + item.y * scaleY * otherScale, item.blur * scaleX * otherScale);
|
|
2114
|
-
|
|
2115
|
-
|
|
2145
|
+
transform = getShadowTransform(ui, other, shape, item, offsetOutBounds, otherScale, true);
|
|
2146
|
+
if (transform) other.setTransform(transform);
|
|
2147
|
+
drawWorldShadow(other, offsetOutBounds, shape);
|
|
2116
2148
|
other.restore();
|
|
2117
2149
|
if (worldCanvas) {
|
|
2118
|
-
other.copyWorld(other,
|
|
2150
|
+
other.copyWorld(other, renderBounds, nowWorld, "copy");
|
|
2119
2151
|
other.copyWorld(worldCanvas, nowWorld, nowWorld, "source-out");
|
|
2120
2152
|
copyBounds = nowWorld;
|
|
2121
2153
|
} else {
|
|
2122
2154
|
other.copyWorld(shape.canvas, shapeBounds, bounds, "source-out");
|
|
2123
|
-
copyBounds =
|
|
2155
|
+
copyBounds = renderBounds;
|
|
2124
2156
|
}
|
|
2125
2157
|
other.fillWorld(copyBounds, draw.ColorConvert.string(item.color), "source-in");
|
|
2126
2158
|
core.LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
|
|
@@ -2129,6 +2161,8 @@ function innerShadow(ui, current, shape) {
|
|
|
2129
2161
|
other.recycle(copyBounds);
|
|
2130
2162
|
}
|
|
2131
2163
|
|
|
2164
|
+
const getInnerShadowSpread = getShadowRenderSpread;
|
|
2165
|
+
|
|
2132
2166
|
function blur(ui, current, origin) {
|
|
2133
2167
|
const {blur: blur} = ui.__;
|
|
2134
2168
|
origin.setWorldBlur(blur * ui.__nowWorld.a);
|
|
@@ -2143,10 +2177,12 @@ const EffectModule = {
|
|
|
2143
2177
|
innerShadow: innerShadow,
|
|
2144
2178
|
blur: blur,
|
|
2145
2179
|
backgroundBlur: backgroundBlur,
|
|
2146
|
-
|
|
2180
|
+
getShadowRenderSpread: getShadowRenderSpread,
|
|
2181
|
+
getShadowTransform: getShadowTransform,
|
|
2147
2182
|
isTransformShadow(_shadow) {
|
|
2148
2183
|
return undefined;
|
|
2149
|
-
}
|
|
2184
|
+
},
|
|
2185
|
+
getInnerShadowSpread: getInnerShadowSpread
|
|
2150
2186
|
};
|
|
2151
2187
|
|
|
2152
2188
|
const {excludeRenderBounds: excludeRenderBounds} = core.LeafBoundsHelper;
|
|
@@ -2163,6 +2199,7 @@ draw.Group.prototype.__renderMask = function(canvas, options) {
|
|
|
2163
2199
|
maskEnd(this, currentMask, canvas, contentCanvas, maskCanvas, maskOpacity, undefined, true);
|
|
2164
2200
|
maskCanvas = contentCanvas = null;
|
|
2165
2201
|
}
|
|
2202
|
+
if (mask === "clipping" || mask === "clipping-path") excludeRenderBounds(child, options) || child.__render(canvas, options);
|
|
2166
2203
|
maskOpacity = child.__.opacity;
|
|
2167
2204
|
usedGrayscaleAlpha = false;
|
|
2168
2205
|
if (mask === "path" || mask === "clipping-path") {
|
|
@@ -2180,7 +2217,6 @@ draw.Group.prototype.__renderMask = function(canvas, options) {
|
|
|
2180
2217
|
if (!contentCanvas) contentCanvas = getCanvas(canvas);
|
|
2181
2218
|
child.__render(maskCanvas, options);
|
|
2182
2219
|
}
|
|
2183
|
-
if (mask === "clipping" || mask === "clipping-path") excludeRenderBounds(child, options) || child.__render(canvas, options);
|
|
2184
2220
|
continue;
|
|
2185
2221
|
}
|
|
2186
2222
|
const childBlendMode = maskOpacity === 1 && child.__.__blendMode;
|