@visactor/vrender 0.20.10-alpha.0 → 0.20.10
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +163 -78
- package/dist/index.js +163 -78
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2732,11 +2732,12 @@
|
|
|
2732
2732
|
for (let i = 0, len = paths.length; i < len; i++) if (currPath = paths[i], coordsStr = currPath.slice(1), commandChar = currPath[0], currCommandData = [commandChar], coordsStrArr = coordsStr.match(rePathCommand), null !== coordsStrArr) {
|
|
2733
2733
|
for (let i = 0, len = coordsStrArr.length; i < len; i++) coordStr = coordsStrArr[i], coordNumber = parseFloat(coordStr), Number.isNaN(coordNumber) || currCommandData.push(coordNumber);
|
|
2734
2734
|
if (standardCommandLen = commandLengths[commandChar], currCommandData.length - 1 > standardCommandLen) {
|
|
2735
|
-
let subCommand
|
|
2735
|
+
let subCommand,
|
|
2736
|
+
bestCommandChar = commandChar;
|
|
2736
2737
|
for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
|
|
2737
|
-
subCommand = [
|
|
2738
|
+
subCommand = [bestCommandChar];
|
|
2738
2739
|
for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) subCommand.push(currCommandData[j]);
|
|
2739
|
-
result.push(subCommand);
|
|
2740
|
+
result.push(subCommand), "m" === bestCommandChar ? bestCommandChar = "l" : "M" === bestCommandChar && (bestCommandChar = "L");
|
|
2740
2741
|
}
|
|
2741
2742
|
} else result.push(currCommandData);
|
|
2742
2743
|
} else result.push(currCommandData);
|
|
@@ -3985,6 +3986,7 @@
|
|
|
3985
3986
|
zIndex: 0,
|
|
3986
3987
|
layout: null,
|
|
3987
3988
|
boundsPadding: 0,
|
|
3989
|
+
fillStrokeOrder: 0,
|
|
3988
3990
|
renderStyle: "default",
|
|
3989
3991
|
pickMode: "accurate",
|
|
3990
3992
|
customPickShape: null,
|
|
@@ -4063,6 +4065,7 @@
|
|
|
4063
4065
|
});
|
|
4064
4066
|
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4065
4067
|
path: new CustomPath2D(),
|
|
4068
|
+
fillStrokeOrder: 1,
|
|
4066
4069
|
customPath: () => {
|
|
4067
4070
|
Logger.getInstance().warn("空函数");
|
|
4068
4071
|
}
|
|
@@ -5088,7 +5091,7 @@
|
|
|
5088
5091
|
}
|
|
5089
5092
|
hasSubView() {
|
|
5090
5093
|
const viewBox = this._handler.getViewBox();
|
|
5091
|
-
return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width
|
|
5094
|
+
return !(0 === viewBox.x1 && 0 === viewBox.y1 && isNumberClose(this.width, viewBox.width()) && isNumberClose(this.height, viewBox.height()));
|
|
5092
5095
|
}
|
|
5093
5096
|
isVisible(bbox) {
|
|
5094
5097
|
return this._handler.isVisible(bbox);
|
|
@@ -12503,7 +12506,8 @@
|
|
|
12503
12506
|
fill = arcAttribute.fill,
|
|
12504
12507
|
stroke = arcAttribute.stroke,
|
|
12505
12508
|
x: originX = arcAttribute.x,
|
|
12506
|
-
y: originY = arcAttribute.y
|
|
12509
|
+
y: originY = arcAttribute.y,
|
|
12510
|
+
fillStrokeOrder = arcAttribute.fillStrokeOrder
|
|
12507
12511
|
} = arc.attribute,
|
|
12508
12512
|
data = this.valid(arc, arcAttribute, fillCb, strokeCb);
|
|
12509
12513
|
if (!data) return;
|
|
@@ -12539,7 +12543,17 @@
|
|
|
12539
12543
|
isFullStroke: isFullStroke,
|
|
12540
12544
|
stroke: arrayStroke
|
|
12541
12545
|
} = parseStroke(stroke);
|
|
12542
|
-
if (
|
|
12546
|
+
if (doFill || isFullStroke) {
|
|
12547
|
+
context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
12548
|
+
const _runFill = () => {
|
|
12549
|
+
doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
|
|
12550
|
+
},
|
|
12551
|
+
_runStroke = () => {
|
|
12552
|
+
doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
|
|
12553
|
+
};
|
|
12554
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
|
|
12555
|
+
}
|
|
12556
|
+
if (!isFullStroke && doStroke) {
|
|
12543
12557
|
context.beginPath();
|
|
12544
12558
|
drawArcPath$1(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
|
|
12545
12559
|
beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
|
|
@@ -12557,14 +12571,20 @@
|
|
|
12557
12571
|
fill = arcAttribute.fill
|
|
12558
12572
|
} = arc.attribute,
|
|
12559
12573
|
startAngle = endAngle;
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12574
|
+
this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
12575
|
+
const _runFill = () => {
|
|
12576
|
+
if (doFill) {
|
|
12577
|
+
const color = fill;
|
|
12578
|
+
if ("conical" === color.gradient) {
|
|
12579
|
+
const lastColor = getConicGradientAt(0, 0, endAngle, color);
|
|
12580
|
+
fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
|
|
12581
|
+
}
|
|
12582
|
+
}
|
|
12583
|
+
},
|
|
12584
|
+
_runStroke = () => {
|
|
12585
|
+
doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
|
|
12586
|
+
};
|
|
12587
|
+
_runFill(), _runStroke();
|
|
12568
12588
|
}
|
|
12569
12589
|
}
|
|
12570
12590
|
this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
|
|
@@ -12602,7 +12622,8 @@
|
|
|
12602
12622
|
startAngle = circleAttribute.startAngle,
|
|
12603
12623
|
endAngle = circleAttribute.endAngle,
|
|
12604
12624
|
x: originX = circleAttribute.x,
|
|
12605
|
-
y: originY = circleAttribute.y
|
|
12625
|
+
y: originY = circleAttribute.y,
|
|
12626
|
+
fillStrokeOrder = circleAttribute.fillStrokeOrder
|
|
12606
12627
|
} = circle.attribute,
|
|
12607
12628
|
data = this.valid(circle, circleAttribute, fillCb, strokeCb);
|
|
12608
12629
|
if (!data) return;
|
|
@@ -12612,7 +12633,14 @@
|
|
|
12612
12633
|
doFill: doFill,
|
|
12613
12634
|
doStroke: doStroke
|
|
12614
12635
|
} = data;
|
|
12615
|
-
context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb)
|
|
12636
|
+
context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
12637
|
+
const _runFill = () => {
|
|
12638
|
+
doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill()));
|
|
12639
|
+
},
|
|
12640
|
+
_runStroke = () => {
|
|
12641
|
+
doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke()));
|
|
12642
|
+
};
|
|
12643
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
12616
12644
|
}
|
|
12617
12645
|
draw(circle, renderService, drawContext, params) {
|
|
12618
12646
|
const circleAttribute = getTheme(circle, null == params ? void 0 : params.theme).circle;
|
|
@@ -13053,7 +13081,7 @@
|
|
|
13053
13081
|
super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
|
|
13054
13082
|
}
|
|
13055
13083
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
13056
|
-
var _a, _b, _c
|
|
13084
|
+
var _a, _b, _c;
|
|
13057
13085
|
const {
|
|
13058
13086
|
points: points
|
|
13059
13087
|
} = area.attribute;
|
|
@@ -13077,28 +13105,31 @@
|
|
|
13077
13105
|
x: originX = 0,
|
|
13078
13106
|
x: originY = 0
|
|
13079
13107
|
} = area.attribute;
|
|
13080
|
-
|
|
13108
|
+
!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
13081
13109
|
attribute: area.attribute
|
|
13082
|
-
}),
|
|
13083
|
-
|
|
13084
|
-
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13110
|
+
}), (() => {
|
|
13111
|
+
var _a, _b;
|
|
13112
|
+
if (stroke) {
|
|
13113
|
+
const {
|
|
13114
|
+
stroke = areaAttribute && areaAttribute.stroke
|
|
13115
|
+
} = area.attribute;
|
|
13116
|
+
if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
13117
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
13118
|
+
for (let i = 1; i < points.length; i++) {
|
|
13119
|
+
const p = points[i];
|
|
13120
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
13121
|
+
}
|
|
13122
|
+
} else if (stroke[2]) {
|
|
13123
|
+
const endP = points[points.length - 1];
|
|
13124
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
13125
|
+
for (let i = points.length - 2; i >= 0; i--) {
|
|
13126
|
+
const p = points[i];
|
|
13127
|
+
context.lineTo((null !== (_a = p.x1) && void 0 !== _a ? _a : p.x) + offsetX, (null !== (_b = p.y1) && void 0 !== _b ? _b : p.y) + offsetY, z);
|
|
13128
|
+
}
|
|
13098
13129
|
}
|
|
13130
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
13099
13131
|
}
|
|
13100
|
-
|
|
13101
|
-
}
|
|
13132
|
+
})();
|
|
13102
13133
|
}
|
|
13103
13134
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
13104
13135
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -13263,23 +13294,24 @@
|
|
|
13263
13294
|
x: originX = 0,
|
|
13264
13295
|
x: originY = 0
|
|
13265
13296
|
} = attribute;
|
|
13266
|
-
|
|
13297
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
13267
13298
|
attribute: attribute
|
|
13268
|
-
}),
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
-
|
|
13282
|
-
|
|
13299
|
+
}), (() => {
|
|
13300
|
+
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
13301
|
+
const {
|
|
13302
|
+
stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
|
|
13303
|
+
} = attribute;
|
|
13304
|
+
isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === exports.Direction.ROW ? "x" : "y", {
|
|
13305
|
+
offsetX: offsetX,
|
|
13306
|
+
offsetY: offsetY,
|
|
13307
|
+
offsetZ: offsetZ,
|
|
13308
|
+
drawConnect: connect,
|
|
13309
|
+
mode: connectedType,
|
|
13310
|
+
zeroX: connectedX,
|
|
13311
|
+
zeroY: connectedY
|
|
13312
|
+
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
13313
|
+
}
|
|
13314
|
+
})(), !1;
|
|
13283
13315
|
}
|
|
13284
13316
|
};
|
|
13285
13317
|
exports.DefaultCanvasAreaRender = __decorate$1v([injectable(), __param$N(0, inject(ContributionProvider)), __param$N(0, named(AreaRenderContribution)), __metadata$19("design:paramtypes", [Object])], exports.DefaultCanvasAreaRender);
|
|
@@ -13311,7 +13343,8 @@
|
|
|
13311
13343
|
const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(path, null == params ? void 0 : params.theme).path,
|
|
13312
13344
|
{
|
|
13313
13345
|
x: originX = pathAttribute.x,
|
|
13314
|
-
y: originY = pathAttribute.y
|
|
13346
|
+
y: originY = pathAttribute.y,
|
|
13347
|
+
fillStrokeOrder = pathAttribute.fillStrokeOrder
|
|
13315
13348
|
} = path.attribute,
|
|
13316
13349
|
z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
|
|
13317
13350
|
data = this.valid(path, pathAttribute, fillCb, strokeCb);
|
|
@@ -13326,7 +13359,14 @@
|
|
|
13326
13359
|
const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
|
|
13327
13360
|
renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
|
|
13328
13361
|
}
|
|
13329
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb)
|
|
13362
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
13363
|
+
const _runStroke = () => {
|
|
13364
|
+
doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke()));
|
|
13365
|
+
},
|
|
13366
|
+
_runFill = () => {
|
|
13367
|
+
doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill()));
|
|
13368
|
+
};
|
|
13369
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
13330
13370
|
}
|
|
13331
13371
|
draw(path, renderService, drawContext, params) {
|
|
13332
13372
|
const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path;
|
|
@@ -13370,7 +13410,8 @@
|
|
|
13370
13410
|
x1: x1,
|
|
13371
13411
|
y1: y1,
|
|
13372
13412
|
x: originX = rectAttribute.x,
|
|
13373
|
-
y: originY = rectAttribute.y
|
|
13413
|
+
y: originY = rectAttribute.y,
|
|
13414
|
+
fillStrokeOrder = rectAttribute.fillStrokeOrder
|
|
13374
13415
|
} = rect.attribute;
|
|
13375
13416
|
let {
|
|
13376
13417
|
width: width,
|
|
@@ -13389,7 +13430,14 @@
|
|
|
13389
13430
|
doFill: doFill,
|
|
13390
13431
|
doStroke: doStroke
|
|
13391
13432
|
};
|
|
13392
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke)
|
|
13433
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
13434
|
+
const _runFill = () => {
|
|
13435
|
+
doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
|
|
13436
|
+
},
|
|
13437
|
+
_runStroke = () => {
|
|
13438
|
+
doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
|
|
13439
|
+
};
|
|
13440
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
13393
13441
|
}
|
|
13394
13442
|
draw(rect, renderService, drawContext, params) {
|
|
13395
13443
|
const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
|
|
@@ -13425,7 +13473,8 @@
|
|
|
13425
13473
|
x: originX = symbolAttribute.x,
|
|
13426
13474
|
y: originY = symbolAttribute.y,
|
|
13427
13475
|
scaleX = symbolAttribute.scaleX,
|
|
13428
|
-
scaleY = symbolAttribute.scaleY
|
|
13476
|
+
scaleY = symbolAttribute.scaleY,
|
|
13477
|
+
fillStrokeOrder = symbolAttribute.fillStrokeOrder
|
|
13429
13478
|
} = symbol.attribute,
|
|
13430
13479
|
data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
|
|
13431
13480
|
if (!data) return;
|
|
@@ -13448,14 +13497,27 @@
|
|
|
13448
13497
|
const obj = Object.assign({}, a);
|
|
13449
13498
|
obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.opacity) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
|
|
13450
13499
|
}
|
|
13451
|
-
|
|
13500
|
+
const _runFill = () => {
|
|
13501
|
+
a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill()));
|
|
13502
|
+
},
|
|
13503
|
+
_runStroke = () => {
|
|
13504
|
+
a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
13505
|
+
};
|
|
13506
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
|
|
13452
13507
|
};
|
|
13453
13508
|
if (keepDirIn3d && context.camera && context.project) {
|
|
13454
13509
|
const p = context.project(x, y, z),
|
|
13455
13510
|
camera = context.camera;
|
|
13456
13511
|
context.camera = null, !1 === parsedPath.draw(context, isArray$1(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, callback) && context.closePath(), context.camera = camera;
|
|
13457
13512
|
} else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
|
|
13458
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb)
|
|
13513
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
13514
|
+
const _runFill = () => {
|
|
13515
|
+
doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
|
|
13516
|
+
},
|
|
13517
|
+
_runStroke = () => {
|
|
13518
|
+
doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
13519
|
+
};
|
|
13520
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
13459
13521
|
}
|
|
13460
13522
|
draw(symbol, renderService, drawContext, params) {
|
|
13461
13523
|
const symbolAttribute = getTheme(symbol, null == params ? void 0 : params.theme).symbol;
|
|
@@ -13842,7 +13904,8 @@
|
|
|
13842
13904
|
cornerRadius = polygonAttribute.cornerRadius,
|
|
13843
13905
|
x: originX = polygonAttribute.x,
|
|
13844
13906
|
y: originY = polygonAttribute.y,
|
|
13845
|
-
closePath = polygonAttribute.closePath
|
|
13907
|
+
closePath = polygonAttribute.closePath,
|
|
13908
|
+
fillStrokeOrder = polygonAttribute.fillStrokeOrder
|
|
13846
13909
|
} = polygon.attribute,
|
|
13847
13910
|
data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
|
|
13848
13911
|
if (!data) return;
|
|
@@ -13852,7 +13915,14 @@
|
|
|
13852
13915
|
doFill: doFill,
|
|
13853
13916
|
doStroke: doStroke
|
|
13854
13917
|
} = data;
|
|
13855
|
-
context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb)
|
|
13918
|
+
context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
13919
|
+
const _runFill = () => {
|
|
13920
|
+
doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
|
|
13921
|
+
},
|
|
13922
|
+
_runStroke = () => {
|
|
13923
|
+
doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke()));
|
|
13924
|
+
};
|
|
13925
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
13856
13926
|
}
|
|
13857
13927
|
draw(polygon, renderService, drawContext, params) {
|
|
13858
13928
|
const polygonAttribute = getTheme(polygon, null == params ? void 0 : params.theme).polygon;
|
|
@@ -13895,7 +13965,8 @@
|
|
|
13895
13965
|
cornerRadius = groupAttribute.cornerRadius,
|
|
13896
13966
|
path = groupAttribute.path,
|
|
13897
13967
|
lineWidth = groupAttribute.lineWidth,
|
|
13898
|
-
visible = groupAttribute.visible
|
|
13968
|
+
visible = groupAttribute.visible,
|
|
13969
|
+
fillStrokeOrder = groupAttribute.fillStrokeOrder
|
|
13899
13970
|
} = group.attribute,
|
|
13900
13971
|
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
13901
13972
|
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
@@ -13921,7 +13992,14 @@
|
|
|
13921
13992
|
};
|
|
13922
13993
|
this._groupRenderContribitions.forEach(c => {
|
|
13923
13994
|
c.time === exports.BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
13924
|
-
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute)
|
|
13995
|
+
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
|
|
13996
|
+
const _runFill = () => {
|
|
13997
|
+
doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill()));
|
|
13998
|
+
},
|
|
13999
|
+
_runStroke = () => {
|
|
14000
|
+
doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke()));
|
|
14001
|
+
};
|
|
14002
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this._groupRenderContribitions.forEach(c => {
|
|
13925
14003
|
c.time === exports.BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
|
|
13926
14004
|
});
|
|
13927
14005
|
}
|
|
@@ -13987,6 +14065,7 @@
|
|
|
13987
14065
|
x: originX = imageAttribute.x,
|
|
13988
14066
|
y: originY = imageAttribute.y,
|
|
13989
14067
|
cornerRadius = imageAttribute.cornerRadius,
|
|
14068
|
+
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
13990
14069
|
image: url
|
|
13991
14070
|
} = image.attribute,
|
|
13992
14071
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -13997,20 +14076,26 @@
|
|
|
13997
14076
|
doFill: doFill,
|
|
13998
14077
|
doStroke: doStroke
|
|
13999
14078
|
} = data;
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14079
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
14080
|
+
const _runFill = () => {
|
|
14081
|
+
if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
|
|
14082
|
+
if (!url || !image.resources) return;
|
|
14083
|
+
const res = image.resources.get(url);
|
|
14084
|
+
if ("success" !== res.state) return;
|
|
14085
|
+
let needRestore = !1;
|
|
14086
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
14087
|
+
let repeat = 0;
|
|
14088
|
+
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
14089
|
+
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
14090
|
+
context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
|
|
14091
|
+
} else context.drawImage(res.data, x, y, width, height);
|
|
14092
|
+
needRestore && context.restore();
|
|
14093
|
+
}
|
|
14094
|
+
},
|
|
14095
|
+
_runStroke = () => {
|
|
14096
|
+
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
|
|
14097
|
+
};
|
|
14098
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
14014
14099
|
}
|
|
14015
14100
|
draw(image, renderService, drawContext) {
|
|
14016
14101
|
const {
|
|
@@ -28478,7 +28563,7 @@
|
|
|
28478
28563
|
|
|
28479
28564
|
const roughModule = _roughModule;
|
|
28480
28565
|
|
|
28481
|
-
const version = "0.20.10
|
|
28566
|
+
const version = "0.20.10";
|
|
28482
28567
|
preLoadAllModule();
|
|
28483
28568
|
if (isBrowserEnv()) {
|
|
28484
28569
|
loadBrowserEnv(container);
|