@visactor/vrender 0.21.9-alpha.1 → 0.21.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 +52 -137
- package/dist/index.js +52 -137
- 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 +3 -3
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,17 +21,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.21.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
(0,
|
|
34
|
-
vrender_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
24
|
+
exports.version = "0.21.10", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
|
+
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
|
+
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
|
+
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
|
28
|
+
(0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(), (0, vrender_kits_2.registerImage)(),
|
|
29
|
+
(0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(), (0, vrender_kits_2.registerPolygon)(),
|
|
30
|
+
(0, vrender_kits_2.registerPyramid3d)(), (0, vrender_kits_2.registerRect)(), (0,
|
|
31
|
+
vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(), (0, vrender_kits_2.registerShadowRoot)(),
|
|
32
|
+
(0, vrender_kits_2.registerSymbol)(), (0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(),
|
|
33
|
+
(0, vrender_core_1.registerFlexLayoutPlugin)(), (0, vrender_core_1.registerViewTransform3dPlugin)(),
|
|
35
34
|
(0, vrender_core_1.registerHtmlAttributePlugin)(), (0, vrender_core_1.registerReactAttributePlugin)(),
|
|
36
35
|
(0, vrender_core_1.registerDirectionalLight)(), (0, vrender_core_1.registerOrthoCamera)(),
|
|
37
36
|
__exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.21.10\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -3363,7 +3363,7 @@ let Step$1 = class Step {
|
|
|
3363
3363
|
default:
|
|
3364
3364
|
if (this._t <= 0) this.context.lineTo(this._x, y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);else {
|
|
3365
3365
|
const x1 = this._x * (1 - this._t) + x * this._t;
|
|
3366
|
-
this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
3366
|
+
.5 === this._t ? this.context.lineTo(x1, this._y, !1 !== this._lastDefined, this.lastPoint) : this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
3367
3367
|
}
|
|
3368
3368
|
}
|
|
3369
3369
|
this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
|
|
@@ -7196,7 +7196,7 @@ class Animate {
|
|
|
7196
7196
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
7197
7197
|
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
7198
7198
|
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
7199
|
-
this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
7199
|
+
this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
7200
7200
|
}
|
|
7201
7201
|
setTimeline(timeline) {
|
|
7202
7202
|
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|
|
@@ -12908,7 +12908,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
12908
12908
|
this._draw(line, lineAttribute, !1, drawContext, params);
|
|
12909
12909
|
}
|
|
12910
12910
|
drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
12911
|
-
var _a
|
|
12911
|
+
var _a;
|
|
12912
12912
|
if (!cache) return;
|
|
12913
12913
|
context.beginPath();
|
|
12914
12914
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
|
|
@@ -12921,27 +12921,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
12921
12921
|
x: originX = 0,
|
|
12922
12922
|
x: originY = 0
|
|
12923
12923
|
} = attribute;
|
|
12924
|
-
!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke()));
|
|
12925
|
-
let {
|
|
12926
|
-
connectedType: connectedType,
|
|
12927
|
-
connectedX: connectedX,
|
|
12928
|
-
connectedY: connectedY,
|
|
12929
|
-
connectedStyle: connectedStyle
|
|
12930
|
-
} = attribute;
|
|
12931
|
-
if (isArray$1(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
|
|
12932
|
-
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
12933
|
-
offsetX: offsetX,
|
|
12934
|
-
offsetY: offsetY,
|
|
12935
|
-
offsetZ: z,
|
|
12936
|
-
drawConnect: !0,
|
|
12937
|
-
mode: connectedType,
|
|
12938
|
-
zeroX: connectedX,
|
|
12939
|
-
zeroY: connectedY
|
|
12940
|
-
});
|
|
12941
|
-
const da = [];
|
|
12942
|
-
isArray$1(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
|
|
12943
|
-
}
|
|
12944
|
-
return !1;
|
|
12924
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke())), !1;
|
|
12945
12925
|
}
|
|
12946
12926
|
drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
|
|
12947
12927
|
var _a;
|
|
@@ -12973,7 +12953,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
12973
12953
|
segments: segments,
|
|
12974
12954
|
points: points,
|
|
12975
12955
|
closePath: closePath,
|
|
12976
|
-
curveTension = lineAttribute.curveTension
|
|
12956
|
+
curveTension = lineAttribute.curveTension,
|
|
12957
|
+
connectedType = lineAttribute.connectedType
|
|
12977
12958
|
} = line.attribute;
|
|
12978
12959
|
if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
|
|
12979
12960
|
let {
|
|
@@ -12985,6 +12966,9 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
12985
12966
|
clipRangeByDimension = lineAttribute.clipRangeByDimension
|
|
12986
12967
|
} = line.attribute;
|
|
12987
12968
|
if (1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
|
|
12969
|
+
function parsePoint(points, connectedType) {
|
|
12970
|
+
return "none" === connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
12971
|
+
}
|
|
12988
12972
|
if (line.shouldUpdateShape()) {
|
|
12989
12973
|
const {
|
|
12990
12974
|
points: points,
|
|
@@ -13006,7 +12990,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
13006
12990
|
y: lastSeg.endY,
|
|
13007
12991
|
defined: lastSeg.curves[lastSeg.curves.length - 1].defined
|
|
13008
12992
|
} : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
|
|
13009
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
12993
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
13010
12994
|
startPoint: startPoint,
|
|
13011
12995
|
curveTension: curveTension
|
|
13012
12996
|
});
|
|
@@ -13025,7 +13009,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
13025
13009
|
}
|
|
13026
13010
|
} else {
|
|
13027
13011
|
if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
|
|
13028
|
-
line.cache = calcLineCache(_points, curveType, {
|
|
13012
|
+
line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
|
|
13029
13013
|
curveTension: curveTension
|
|
13030
13014
|
});
|
|
13031
13015
|
}
|
|
@@ -13057,11 +13041,6 @@ DefaultCanvasLineRender = __decorate$1y([injectable()], DefaultCanvasLineRender)
|
|
|
13057
13041
|
|
|
13058
13042
|
function drawAreaSegments(path, segPath, percent, params) {
|
|
13059
13043
|
var _a;
|
|
13060
|
-
const {
|
|
13061
|
-
drawConnect = !1,
|
|
13062
|
-
mode = "none"
|
|
13063
|
-
} = params || {};
|
|
13064
|
-
if (drawConnect && "none" === mode) return;
|
|
13065
13044
|
const {
|
|
13066
13045
|
top: top,
|
|
13067
13046
|
bottom: bottom
|
|
@@ -13071,34 +13050,11 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
13071
13050
|
const topList = [],
|
|
13072
13051
|
bottomList = [];
|
|
13073
13052
|
let lastDefined = !0;
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
|
|
13077
|
-
defined0 = !0;
|
|
13078
|
-
const n = top.curves.length;
|
|
13079
|
-
top.curves.forEach((curve, i) => {
|
|
13080
|
-
const bototmCurve = bottom.curves[n - i - 1];
|
|
13081
|
-
let currentTopCurve = curve,
|
|
13082
|
-
currentBottomCurve = bototmCurve;
|
|
13083
|
-
if (curve.originP1 === curve.originP2) return lastCurve = curve, void (lastBottomCurve = bototmCurve);
|
|
13084
|
-
if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (currentTopCurve = lastCurve, currentBottomCurve = lastBottomCurve), curve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
13085
|
-
const {
|
|
13086
|
-
originP1: originP1,
|
|
13087
|
-
originP2: originP2
|
|
13088
|
-
} = curve;
|
|
13089
|
-
let validTopCurve, validBottomCurve;
|
|
13090
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = curve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || curve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || curve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
13091
|
-
}
|
|
13092
|
-
lastCurve = curve;
|
|
13093
|
-
}), drawAreaConnectBlock(path, topList, bottomList, params);
|
|
13094
|
-
} else {
|
|
13095
|
-
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
13096
|
-
const topCurve = top.curves[i];
|
|
13097
|
-
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1])), lastDefined = !lastDefined) : lastDefined && (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1]));
|
|
13098
|
-
}
|
|
13099
|
-
drawAreaBlock(path, topList, bottomList, params);
|
|
13053
|
+
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
13054
|
+
const topCurve = top.curves[i];
|
|
13055
|
+
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1])), lastDefined = !lastDefined) : lastDefined && (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1]));
|
|
13100
13056
|
}
|
|
13101
|
-
return;
|
|
13057
|
+
return void drawAreaBlock(path, topList, bottomList, params);
|
|
13102
13058
|
}
|
|
13103
13059
|
if (percent <= 0) return;
|
|
13104
13060
|
let {
|
|
@@ -13116,51 +13072,17 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
13116
13072
|
lastDefined = !0;
|
|
13117
13073
|
const topList = [],
|
|
13118
13074
|
bottomList = [];
|
|
13119
|
-
let lastTopCurve,
|
|
13120
|
-
lastBottomCurve,
|
|
13121
|
-
defined0 = !0;
|
|
13122
13075
|
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
13123
13076
|
const topCurve = top.curves[i],
|
|
13124
13077
|
curCurveLength = topCurve.getLength(direction),
|
|
13125
13078
|
percent = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
|
|
13126
13079
|
if (percent < 0) break;
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
if (topCurve.originP1 === topCurve.originP2) {
|
|
13132
|
-
lastTopCurve = topCurve, lastBottomCurve = bototmCurve;
|
|
13133
|
-
continue;
|
|
13134
|
-
}
|
|
13135
|
-
if (lastTopCurve && lastTopCurve.originP1 === lastTopCurve.originP2 && (currentTopCurve = lastTopCurve, currentBottomCurve = lastBottomCurve), topCurve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
13136
|
-
const {
|
|
13137
|
-
originP1: originP1,
|
|
13138
|
-
originP2: originP2
|
|
13139
|
-
} = topCurve;
|
|
13140
|
-
let validTopCurve, validBottomCurve;
|
|
13141
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = topCurve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || topCurve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || topCurve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
13142
|
-
}
|
|
13143
|
-
lastTopCurve = topCurve;
|
|
13144
|
-
} else {
|
|
13145
|
-
let tc = null,
|
|
13146
|
-
bc = null;
|
|
13147
|
-
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = topCurve, bc = bottom.curves[n - i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = topCurve, bc = bottom.curves[n - i - 1]), tc && bc && (percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic(tc, percent)[0] : divideLinear(tc, percent)[0], bc = bc.p2 && bc.p3 ? divideCubic(bc, 1 - percent)[1] : divideLinear(bc, 1 - percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
13148
|
-
}
|
|
13080
|
+
drawedLengthUntilLast += curCurveLength;
|
|
13081
|
+
let tc = null,
|
|
13082
|
+
bc = null;
|
|
13083
|
+
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = topCurve, bc = bottom.curves[n - i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = topCurve, bc = bottom.curves[n - i - 1]), tc && bc && (percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic(tc, percent)[0] : divideLinear(tc, percent)[0], bc = bc.p2 && bc.p3 ? divideCubic(bc, 1 - percent)[1] : divideLinear(bc, 1 - percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
13149
13084
|
}
|
|
13150
|
-
|
|
13151
|
-
}
|
|
13152
|
-
function drawAreaConnectBlock(path, topList, bottomList, params) {
|
|
13153
|
-
if (topList.length < 2) return;
|
|
13154
|
-
const {
|
|
13155
|
-
offsetX = 0,
|
|
13156
|
-
offsetY = 0,
|
|
13157
|
-
offsetZ = 0,
|
|
13158
|
-
mode: mode
|
|
13159
|
-
} = params || {};
|
|
13160
|
-
let curve = topList[0];
|
|
13161
|
-
path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = topList[topList.length - 1];
|
|
13162
|
-
let end = curve.p3 || curve.p1;
|
|
13163
|
-
path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), curve = bottomList[bottomList.length - 1], path.lineTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = bottomList[0], end = curve.p3 || curve.p1, path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), path.closePath();
|
|
13085
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
13164
13086
|
}
|
|
13165
13087
|
function drawAreaBlock(path, topList, bottomList, params) {
|
|
13166
13088
|
const {
|
|
@@ -13261,7 +13183,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13261
13183
|
fillOpacity = areaAttribute.fillOpacity,
|
|
13262
13184
|
z = areaAttribute.z,
|
|
13263
13185
|
strokeOpacity = areaAttribute.strokeOpacity,
|
|
13264
|
-
curveTension = areaAttribute.curveTension
|
|
13186
|
+
curveTension = areaAttribute.curveTension,
|
|
13187
|
+
connectedType = areaAttribute.connectedType
|
|
13265
13188
|
} = area.attribute,
|
|
13266
13189
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
13267
13190
|
if (!data) return;
|
|
@@ -13278,6 +13201,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13278
13201
|
let {
|
|
13279
13202
|
curveType = areaAttribute.curveType
|
|
13280
13203
|
} = area.attribute;
|
|
13204
|
+
function parsePoint(points, connectedType) {
|
|
13205
|
+
return "connect" !== connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
13206
|
+
}
|
|
13281
13207
|
if (closePath && "linear" === curveType && (curveType = "linearClosed"), 1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearAreaHighPerformance(area, context, !!fill, doStroke, fillOpacity, strokeOpacity, x, y, areaAttribute, drawContext, params, fillCb, strokeCb);
|
|
13282
13208
|
if (area.shouldUpdateShape()) {
|
|
13283
13209
|
if (segments && segments.length) {
|
|
@@ -13291,7 +13217,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13291
13217
|
x: lastTopSeg.endX,
|
|
13292
13218
|
y: lastTopSeg.endY
|
|
13293
13219
|
} : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
|
|
13294
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
13220
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
13295
13221
|
startPoint: startPoint,
|
|
13296
13222
|
curveTension: curveTension
|
|
13297
13223
|
});
|
|
@@ -13314,7 +13240,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13314
13240
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
13315
13241
|
});
|
|
13316
13242
|
}
|
|
13317
|
-
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
13243
|
+
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(parsePoint(bottomPoints, connectedType), "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
13318
13244
|
curveTension: curveTension
|
|
13319
13245
|
}), bottomCaches.unshift(lastBottomSeg));
|
|
13320
13246
|
}
|
|
@@ -13325,11 +13251,11 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13325
13251
|
} else {
|
|
13326
13252
|
if (!points || !points.length) return area.cacheArea = null, void area.clearUpdateShapeTag();
|
|
13327
13253
|
{
|
|
13328
|
-
const topPoints = points,
|
|
13254
|
+
const topPoints = parsePoint(points, connectedType),
|
|
13329
13255
|
bottomPoints = [];
|
|
13330
|
-
for (let i =
|
|
13331
|
-
x: null !== (_e = points[i].x1) && void 0 !== _e ? _e :
|
|
13332
|
-
y: null !== (_f = points[i].y1) && void 0 !== _f ? _f :
|
|
13256
|
+
for (let i = topPoints.length - 1; i >= 0; i--) bottomPoints.push({
|
|
13257
|
+
x: null !== (_e = points[i].x1) && void 0 !== _e ? _e : topPoints[i].x,
|
|
13258
|
+
y: null !== (_f = points[i].y1) && void 0 !== _f ? _f : topPoints[i].y
|
|
13333
13259
|
});
|
|
13334
13260
|
const topCache = calcLineCache(topPoints, curveType, {
|
|
13335
13261
|
curveTension: curveTension
|
|
@@ -13371,20 +13297,10 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13371
13297
|
this._draw(area, areaAttribute, !1, drawContext, params);
|
|
13372
13298
|
}
|
|
13373
13299
|
drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
13374
|
-
|
|
13375
|
-
return ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !1, fillCb, strokeCb), ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !0, fillCb, strokeCb), ret;
|
|
13300
|
+
return this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb);
|
|
13376
13301
|
}
|
|
13377
|
-
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext,
|
|
13378
|
-
var _a, _b, _c, _d;
|
|
13302
|
+
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
13379
13303
|
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
13380
|
-
let {
|
|
13381
|
-
connectedType: connectedType,
|
|
13382
|
-
connectedX: connectedX,
|
|
13383
|
-
connectedY: connectedY,
|
|
13384
|
-
connectedStyle: connectedStyle
|
|
13385
|
-
} = attribute;
|
|
13386
|
-
const da = [];
|
|
13387
|
-
if (connect && (isArray$1(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$1(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
13388
13304
|
context.beginPath();
|
|
13389
13305
|
const {
|
|
13390
13306
|
points: points,
|
|
@@ -13403,11 +13319,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13403
13319
|
offsetX: offsetX,
|
|
13404
13320
|
offsetY: offsetY,
|
|
13405
13321
|
offsetZ: offsetZ,
|
|
13406
|
-
direction: direction
|
|
13407
|
-
drawConnect: connect,
|
|
13408
|
-
mode: connectedType,
|
|
13409
|
-
zeroX: connectedX,
|
|
13410
|
-
zeroY: connectedY
|
|
13322
|
+
direction: direction
|
|
13411
13323
|
}), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
13412
13324
|
attribute: attribute
|
|
13413
13325
|
}), context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
@@ -13415,7 +13327,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13415
13327
|
x: originX = 0,
|
|
13416
13328
|
x: originY = 0
|
|
13417
13329
|
} = attribute;
|
|
13418
|
-
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area,
|
|
13330
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
13419
13331
|
attribute: attribute
|
|
13420
13332
|
}), (() => {
|
|
13421
13333
|
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
@@ -13425,12 +13337,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
13425
13337
|
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 === Direction$1.ROW ? "x" : "y", {
|
|
13426
13338
|
offsetX: offsetX,
|
|
13427
13339
|
offsetY: offsetY,
|
|
13428
|
-
offsetZ: offsetZ
|
|
13429
|
-
|
|
13430
|
-
mode: connectedType,
|
|
13431
|
-
zeroX: connectedX,
|
|
13432
|
-
zeroY: connectedY
|
|
13433
|
-
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
13340
|
+
offsetZ: offsetZ
|
|
13341
|
+
})), context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke();
|
|
13434
13342
|
}
|
|
13435
13343
|
})(), !1;
|
|
13436
13344
|
}
|
|
@@ -15888,7 +15796,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
15888
15796
|
} = attribute,
|
|
15889
15797
|
b = aabbBounds;
|
|
15890
15798
|
return points.forEach(p => {
|
|
15891
|
-
!1 === p.defined && "
|
|
15799
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
15892
15800
|
}), b;
|
|
15893
15801
|
}
|
|
15894
15802
|
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
@@ -15899,7 +15807,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
15899
15807
|
b = aabbBounds;
|
|
15900
15808
|
return segments.forEach(s => {
|
|
15901
15809
|
s.points.forEach(p => {
|
|
15902
|
-
!1 === p.defined && "
|
|
15810
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
15903
15811
|
});
|
|
15904
15812
|
}), b;
|
|
15905
15813
|
}
|
|
@@ -25948,6 +25856,7 @@ var __decorate$F = undefined && undefined.__decorate || function (decorators, ta
|
|
|
25948
25856
|
function makeUpCanvas$4(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
|
|
25949
25857
|
const dpr = null != pixelRatio ? pixelRatio : tt.getSystemInfoSync().pixelRatio;
|
|
25950
25858
|
canvasIdLists.forEach((id, i) => {
|
|
25859
|
+
if (canvasMap.has(id)) return;
|
|
25951
25860
|
const ctx = tt.createCanvasContext(id),
|
|
25952
25861
|
canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
|
|
25953
25862
|
ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
|
|
@@ -26085,7 +25994,13 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
26085
25994
|
measureText(text) {
|
|
26086
25995
|
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
26087
25996
|
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
26088
|
-
return
|
|
25997
|
+
return {
|
|
25998
|
+
width: super.measureText(text, method).width,
|
|
25999
|
+
fontBoundingBoxDescent: void 0,
|
|
26000
|
+
fontBoundingBoxAscent: void 0,
|
|
26001
|
+
actualBoundingBoxAscent: void 0,
|
|
26002
|
+
actualBoundingBoxDescent: void 0
|
|
26003
|
+
};
|
|
26089
26004
|
}
|
|
26090
26005
|
createPattern(image, repetition) {
|
|
26091
26006
|
return null;
|
|
@@ -27288,7 +27203,7 @@ function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCan
|
|
|
27288
27203
|
const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
27289
27204
|
for (let i = 0; i < canvasIdLists.length; i++) {
|
|
27290
27205
|
const id = canvasIdLists[i];
|
|
27291
|
-
yield new Promise(resolve => {
|
|
27206
|
+
canvasMap.has(id) || (yield new Promise(resolve => {
|
|
27292
27207
|
let data = wx.createSelectorQuery();
|
|
27293
27208
|
component && (data = data.in(component)), data.select(`#${id}`).fields({
|
|
27294
27209
|
node: !0,
|
|
@@ -27300,7 +27215,7 @@ function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCan
|
|
|
27300
27215
|
height = res[0].height;
|
|
27301
27216
|
canvas.width = width * dpr, canvas.height = height * dpr, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), resolve(null);
|
|
27302
27217
|
});
|
|
27303
|
-
});
|
|
27218
|
+
}));
|
|
27304
27219
|
}
|
|
27305
27220
|
});
|
|
27306
27221
|
}
|
|
@@ -27621,7 +27536,7 @@ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanva
|
|
|
27621
27536
|
const dpr = tt.getSystemInfoSync().pixelRatio;
|
|
27622
27537
|
for (let i = 0; i < canvasIdLists.length; i++) {
|
|
27623
27538
|
const id = canvasIdLists[i];
|
|
27624
|
-
yield new Promise(resolve => {
|
|
27539
|
+
canvasMap.has(id) || (yield new Promise(resolve => {
|
|
27625
27540
|
let data = tt.createSelectorQuery();
|
|
27626
27541
|
component && (data = data.in(component)), data.select(`#${id}`).node().exec(res => {
|
|
27627
27542
|
const canvas = res[0].node,
|
|
@@ -27629,7 +27544,7 @@ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanva
|
|
|
27629
27544
|
height = canvas.height;
|
|
27630
27545
|
canvas.width = width * dpr, canvas.height = height * dpr, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), resolve(null);
|
|
27631
27546
|
});
|
|
27632
|
-
});
|
|
27547
|
+
}));
|
|
27633
27548
|
}
|
|
27634
27549
|
});
|
|
27635
27550
|
}
|
|
@@ -29469,7 +29384,7 @@ const registerWrapText = _registerWrapText;
|
|
|
29469
29384
|
|
|
29470
29385
|
const roughModule = _roughModule;
|
|
29471
29386
|
|
|
29472
|
-
const version = "0.21.
|
|
29387
|
+
const version = "0.21.10";
|
|
29473
29388
|
preLoadAllModule();
|
|
29474
29389
|
if (isBrowserEnv()) {
|
|
29475
29390
|
loadBrowserEnv(container);
|