@visactor/vrender 0.20.22 → 0.20.23

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "0.20.22";
2
+ export declare const version = "0.20.23";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,7 +21,7 @@ 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.20.22", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
24
+ exports.version = "0.20.23", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
25
25
  vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
26
26
  vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
27
27
  (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
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,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.20.22\";\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"]}
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.20.23\";\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
@@ -3324,7 +3324,7 @@ let Step$1 = class Step {
3324
3324
  default:
3325
3325
  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 {
3326
3326
  const x1 = this._x * (1 - this._t) + x * this._t;
3327
- 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);
3327
+ .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);
3328
3328
  }
3329
3329
  }
3330
3330
  this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
@@ -12803,7 +12803,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
12803
12803
  this._draw(line, lineAttribute, !1, drawContext, params);
12804
12804
  }
12805
12805
  drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
12806
- var _a, _b, _c, _d, _e;
12806
+ var _a;
12807
12807
  if (!cache) return;
12808
12808
  context.beginPath();
12809
12809
  const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
@@ -12816,27 +12816,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
12816
12816
  x: originX = 0,
12817
12817
  x: originY = 0
12818
12818
  } = attribute;
12819
- !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()));
12820
- let {
12821
- connectedType: connectedType,
12822
- connectedX: connectedX,
12823
- connectedY: connectedY,
12824
- connectedStyle: connectedStyle
12825
- } = attribute;
12826
- 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) {
12827
- context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
12828
- offsetX: offsetX,
12829
- offsetY: offsetY,
12830
- offsetZ: z,
12831
- drawConnect: !0,
12832
- mode: connectedType,
12833
- zeroX: connectedX,
12834
- zeroY: connectedY
12835
- });
12836
- const da = [];
12837
- 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()));
12838
- }
12839
- return !1;
12819
+ 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;
12840
12820
  }
12841
12821
  drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
12842
12822
  var _a;
@@ -12868,7 +12848,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
12868
12848
  segments: segments,
12869
12849
  points: points,
12870
12850
  closePath: closePath,
12871
- curveTension = lineAttribute.curveTension
12851
+ curveTension = lineAttribute.curveTension,
12852
+ connectedType = lineAttribute.connectedType
12872
12853
  } = line.attribute;
12873
12854
  if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
12874
12855
  let {
@@ -12880,6 +12861,9 @@ let DefaultCanvasLineRender = class extends BaseRender {
12880
12861
  clipRangeByDimension = lineAttribute.clipRangeByDimension
12881
12862
  } = line.attribute;
12882
12863
  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);
12864
+ function parsePoint(points, connectedType) {
12865
+ return "none" === connectedType ? points : points.filter(p => !1 !== p.defined);
12866
+ }
12883
12867
  if (line.shouldUpdateShape()) {
12884
12868
  const {
12885
12869
  points: points,
@@ -12901,7 +12885,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
12901
12885
  y: lastSeg.endY,
12902
12886
  defined: lastSeg.curves[lastSeg.curves.length - 1].defined
12903
12887
  } : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
12904
- const data = calcLineCache(seg.points, curveType, {
12888
+ const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
12905
12889
  startPoint: startPoint,
12906
12890
  curveTension: curveTension
12907
12891
  });
@@ -12920,7 +12904,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
12920
12904
  }
12921
12905
  } else {
12922
12906
  if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
12923
- line.cache = calcLineCache(_points, curveType, {
12907
+ line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
12924
12908
  curveTension: curveTension
12925
12909
  });
12926
12910
  }
@@ -12952,11 +12936,6 @@ DefaultCanvasLineRender = __decorate$1w([injectable()], DefaultCanvasLineRender)
12952
12936
 
12953
12937
  function drawAreaSegments(path, segPath, percent, params) {
12954
12938
  var _a;
12955
- const {
12956
- drawConnect = !1,
12957
- mode = "none"
12958
- } = params || {};
12959
- if (drawConnect && "none" === mode) return;
12960
12939
  const {
12961
12940
  top: top,
12962
12941
  bottom: bottom
@@ -12966,34 +12945,11 @@ function drawAreaSegments(path, segPath, percent, params) {
12966
12945
  const topList = [],
12967
12946
  bottomList = [];
12968
12947
  let lastDefined = !0;
12969
- if (drawConnect) {
12970
- let lastCurve,
12971
- lastBottomCurve,
12972
- defined0 = !0;
12973
- const n = top.curves.length;
12974
- top.curves.forEach((curve, i) => {
12975
- const bototmCurve = bottom.curves[n - i - 1];
12976
- let currentTopCurve = curve,
12977
- currentBottomCurve = bototmCurve;
12978
- if (curve.originP1 === curve.originP2) return lastCurve = curve, void (lastBottomCurve = bototmCurve);
12979
- 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 {
12980
- const {
12981
- originP1: originP1,
12982
- originP2: originP2
12983
- } = curve;
12984
- let validTopCurve, validBottomCurve;
12985
- 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);
12986
- }
12987
- lastCurve = curve;
12988
- }), drawAreaConnectBlock(path, topList, bottomList, params);
12989
- } else {
12990
- for (let i = 0, n = top.curves.length; i < n; i++) {
12991
- const topCurve = top.curves[i];
12992
- 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]));
12993
- }
12994
- drawAreaBlock(path, topList, bottomList, params);
12948
+ for (let i = 0, n = top.curves.length; i < n; i++) {
12949
+ const topCurve = top.curves[i];
12950
+ 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]));
12995
12951
  }
12996
- return;
12952
+ return void drawAreaBlock(path, topList, bottomList, params);
12997
12953
  }
12998
12954
  if (percent <= 0) return;
12999
12955
  let {
@@ -13011,51 +12967,17 @@ function drawAreaSegments(path, segPath, percent, params) {
13011
12967
  lastDefined = !0;
13012
12968
  const topList = [],
13013
12969
  bottomList = [];
13014
- let lastTopCurve,
13015
- lastBottomCurve,
13016
- defined0 = !0;
13017
12970
  for (let i = 0, n = top.curves.length; i < n; i++) {
13018
12971
  const topCurve = top.curves[i],
13019
12972
  curCurveLength = topCurve.getLength(direction),
13020
12973
  percent = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
13021
12974
  if (percent < 0) break;
13022
- if (drawedLengthUntilLast += curCurveLength, drawConnect) {
13023
- const bototmCurve = bottom.curves[n - i - 1];
13024
- let currentTopCurve = topCurve,
13025
- currentBottomCurve = bototmCurve;
13026
- if (topCurve.originP1 === topCurve.originP2) {
13027
- lastTopCurve = topCurve, lastBottomCurve = bototmCurve;
13028
- continue;
13029
- }
13030
- 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 {
13031
- const {
13032
- originP1: originP1,
13033
- originP2: originP2
13034
- } = topCurve;
13035
- let validTopCurve, validBottomCurve;
13036
- 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);
13037
- }
13038
- lastTopCurve = topCurve;
13039
- } else {
13040
- let tc = null,
13041
- bc = null;
13042
- 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;
13043
- }
12975
+ drawedLengthUntilLast += curCurveLength;
12976
+ let tc = null,
12977
+ bc = null;
12978
+ 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;
13044
12979
  }
13045
- drawConnect ? drawAreaConnectBlock(path, topList, bottomList, params) : drawAreaBlock(path, topList, bottomList, params);
13046
- }
13047
- function drawAreaConnectBlock(path, topList, bottomList, params) {
13048
- if (topList.length < 2) return;
13049
- const {
13050
- offsetX = 0,
13051
- offsetY = 0,
13052
- offsetZ = 0,
13053
- mode: mode
13054
- } = params || {};
13055
- let curve = topList[0];
13056
- path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = topList[topList.length - 1];
13057
- let end = curve.p3 || curve.p1;
13058
- 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();
12980
+ drawAreaBlock(path, topList, bottomList, params);
13059
12981
  }
13060
12982
  function drawAreaBlock(path, topList, bottomList, params) {
13061
12983
  const {
@@ -13156,7 +13078,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13156
13078
  fillOpacity = areaAttribute.fillOpacity,
13157
13079
  z = areaAttribute.z,
13158
13080
  strokeOpacity = areaAttribute.strokeOpacity,
13159
- curveTension = areaAttribute.curveTension
13081
+ curveTension = areaAttribute.curveTension,
13082
+ connectedType = areaAttribute.connectedType
13160
13083
  } = area.attribute,
13161
13084
  data = this.valid(area, areaAttribute, fillCb, strokeCb);
13162
13085
  if (!data) return;
@@ -13173,6 +13096,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13173
13096
  let {
13174
13097
  curveType = areaAttribute.curveType
13175
13098
  } = area.attribute;
13099
+ function parsePoint(points, connectedType) {
13100
+ return "connect" !== connectedType ? points : points.filter(p => !1 !== p.defined);
13101
+ }
13176
13102
  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);
13177
13103
  if (area.shouldUpdateShape()) {
13178
13104
  if (segments && segments.length) {
@@ -13186,7 +13112,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13186
13112
  x: lastTopSeg.endX,
13187
13113
  y: lastTopSeg.endY
13188
13114
  } : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
13189
- const data = calcLineCache(seg.points, curveType, {
13115
+ const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
13190
13116
  startPoint: startPoint,
13191
13117
  curveTension: curveTension
13192
13118
  });
@@ -13209,7 +13135,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13209
13135
  y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
13210
13136
  });
13211
13137
  }
13212
- bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
13138
+ bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(parsePoint(bottomPoints, connectedType), "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
13213
13139
  curveTension: curveTension
13214
13140
  }), bottomCaches.unshift(lastBottomSeg));
13215
13141
  }
@@ -13220,11 +13146,11 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13220
13146
  } else {
13221
13147
  if (!points || !points.length) return area.cacheArea = null, void area.clearUpdateShapeTag();
13222
13148
  {
13223
- const topPoints = points,
13149
+ const topPoints = parsePoint(points, connectedType),
13224
13150
  bottomPoints = [];
13225
- for (let i = points.length - 1; i >= 0; i--) bottomPoints.push({
13226
- x: null !== (_e = points[i].x1) && void 0 !== _e ? _e : points[i].x,
13227
- y: null !== (_f = points[i].y1) && void 0 !== _f ? _f : points[i].y
13151
+ for (let i = topPoints.length - 1; i >= 0; i--) bottomPoints.push({
13152
+ x: null !== (_e = points[i].x1) && void 0 !== _e ? _e : topPoints[i].x,
13153
+ y: null !== (_f = points[i].y1) && void 0 !== _f ? _f : topPoints[i].y
13228
13154
  });
13229
13155
  const topCache = calcLineCache(topPoints, curveType, {
13230
13156
  curveTension: curveTension
@@ -13266,20 +13192,10 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13266
13192
  this._draw(area, areaAttribute, !1, drawContext, params);
13267
13193
  }
13268
13194
  drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
13269
- let ret = !1;
13270
- 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;
13195
+ return this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb);
13271
13196
  }
13272
- _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
13273
- var _a, _b, _c, _d;
13197
+ _drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
13274
13198
  if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
13275
- let {
13276
- connectedType: connectedType,
13277
- connectedX: connectedX,
13278
- connectedY: connectedY,
13279
- connectedStyle: connectedStyle
13280
- } = attribute;
13281
- const da = [];
13282
- 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;
13283
13199
  context.beginPath();
13284
13200
  const {
13285
13201
  points: points,
@@ -13298,11 +13214,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13298
13214
  offsetX: offsetX,
13299
13215
  offsetY: offsetY,
13300
13216
  offsetZ: offsetZ,
13301
- direction: direction,
13302
- drawConnect: connect,
13303
- mode: connectedType,
13304
- zeroX: connectedX,
13305
- zeroY: connectedY
13217
+ direction: direction
13306
13218
  }), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
13307
13219
  attribute: attribute
13308
13220
  }), context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
@@ -13310,7 +13222,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13310
13222
  x: originX = 0,
13311
13223
  x: originY = 0
13312
13224
  } = attribute;
13313
- 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, {
13225
+ 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, {
13314
13226
  attribute: attribute
13315
13227
  }), (() => {
13316
13228
  if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
@@ -13320,12 +13232,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
13320
13232
  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", {
13321
13233
  offsetX: offsetX,
13322
13234
  offsetY: offsetY,
13323
- offsetZ: offsetZ,
13324
- drawConnect: connect,
13325
- mode: connectedType,
13326
- zeroX: connectedX,
13327
- zeroY: connectedY
13328
- })), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
13235
+ offsetZ: offsetZ
13236
+ })), context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke();
13329
13237
  }
13330
13238
  })(), !1;
13331
13239
  }
@@ -15892,7 +15800,7 @@ let Line$1 = class Line extends Graphic {
15892
15800
  } = attribute,
15893
15801
  b = aabbBounds;
15894
15802
  return points.forEach(p => {
15895
- !1 === p.defined && "zero" !== connectedType && "connect" !== connectedType || b.add(p.x, p.y);
15803
+ !1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
15896
15804
  }), b;
15897
15805
  }
15898
15806
  updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
@@ -15903,7 +15811,7 @@ let Line$1 = class Line extends Graphic {
15903
15811
  b = aabbBounds;
15904
15812
  return segments.forEach(s => {
15905
15813
  s.points.forEach(p => {
15906
- !1 === p.defined && "zero" !== connectedType && "connect" !== connectedType || b.add(p.x, p.y);
15814
+ !1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
15907
15815
  });
15908
15816
  }), b;
15909
15817
  }
@@ -28632,7 +28540,7 @@ const registerWrapText = _registerWrapText;
28632
28540
 
28633
28541
  const roughModule = _roughModule;
28634
28542
 
28635
- const version = "0.20.22";
28543
+ const version = "0.20.23";
28636
28544
  preLoadAllModule();
28637
28545
  if (isBrowserEnv()) {
28638
28546
  loadBrowserEnv(container);