@antv/g-lite 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -6857,12 +6857,13 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
6857
6857
  this.getAnimations().forEach(function (animation) {
6858
6858
  animation.cancel();
6859
6859
  });
6860
- this.renderable = null;
6861
- this.cullable = null;
6862
- this.transformable = null;
6863
- this.rBushNode = null;
6864
- this.geometry = null;
6865
- this.sortable = null;
6860
+ // FIXME
6861
+ // this.renderable = null;
6862
+ // this.cullable = null;
6863
+ // this.transformable = null;
6864
+ // this.rBushNode = null;
6865
+ // this.geometry = null;
6866
+ // this.sortable = null;
6866
6867
  };
6867
6868
  _proto.cloneNode = function cloneNode(deep, customCloneFunc) {
6868
6869
  var clonedStyle = _extends({}, this.attributes);
@@ -15042,9 +15043,14 @@ var TextService = /*#__PURE__*/function () {
15042
15043
  letterSpacing = parsedStyle.letterSpacing,
15043
15044
  _parsedStyle$maxLines = parsedStyle.maxLines,
15044
15045
  maxLines = _parsedStyle$maxLines === void 0 ? Infinity : _parsedStyle$maxLines,
15045
- textOverflow = parsedStyle.textOverflow;
15046
+ textOverflow = parsedStyle.textOverflow,
15047
+ metrics = parsedStyle.metrics;
15046
15048
  var context = this.runtime.offscreenCanvas.getOrCreateContext(offscreenCanvas);
15047
15049
  var maxWidth = wordWrapWidth + letterSpacing;
15050
+ // single line & no need to wrap
15051
+ if (maxLines === 1 && metrics.width <= maxWidth) {
15052
+ return text;
15053
+ }
15048
15054
  var ellipsis = '';
15049
15055
  if (textOverflow === 'ellipsis') {
15050
15056
  ellipsis = '...';
package/dist/index.js CHANGED
@@ -6857,12 +6857,13 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
6857
6857
  this.getAnimations().forEach(function (animation) {
6858
6858
  animation.cancel();
6859
6859
  });
6860
- this.renderable = null;
6861
- this.cullable = null;
6862
- this.transformable = null;
6863
- this.rBushNode = null;
6864
- this.geometry = null;
6865
- this.sortable = null;
6860
+ // FIXME
6861
+ // this.renderable = null;
6862
+ // this.cullable = null;
6863
+ // this.transformable = null;
6864
+ // this.rBushNode = null;
6865
+ // this.geometry = null;
6866
+ // this.sortable = null;
6866
6867
  };
6867
6868
  _proto.cloneNode = function cloneNode(deep, customCloneFunc) {
6868
6869
  var clonedStyle = _extends({}, this.attributes);
@@ -15035,9 +15036,14 @@ var TextService = /*#__PURE__*/function () {
15035
15036
  letterSpacing = parsedStyle.letterSpacing,
15036
15037
  _parsedStyle$maxLines = parsedStyle.maxLines,
15037
15038
  maxLines = _parsedStyle$maxLines === void 0 ? Infinity : _parsedStyle$maxLines,
15038
- textOverflow = parsedStyle.textOverflow;
15039
+ textOverflow = parsedStyle.textOverflow,
15040
+ metrics = parsedStyle.metrics;
15039
15041
  var context = this.runtime.offscreenCanvas.getOrCreateContext(offscreenCanvas);
15040
15042
  var maxWidth = wordWrapWidth + letterSpacing;
15043
+ // single line & no need to wrap
15044
+ if (maxLines === 1 && metrics.width <= maxWidth) {
15045
+ return text;
15046
+ }
15041
15047
  var ellipsis = '';
15042
15048
  if (textOverflow === 'ellipsis') {
15043
15049
  ellipsis = '...';
package/dist/index.umd.js CHANGED
@@ -9612,6 +9612,7 @@
9612
9612
  function piMod(angle) {
9613
9613
  return (angle + Math.PI * 2) % (Math.PI * 2);
9614
9614
  }
9615
+
9615
9616
  var line = {
9616
9617
  /**
9617
9618
  * 计算线段的包围盒
@@ -9706,6 +9707,7 @@
9706
9707
  return Math.atan2(y2 - y1, x2 - x1);
9707
9708
  }
9708
9709
  };
9710
+
9709
9711
  var EPSILON$1 = 0.0001;
9710
9712
  /**
9711
9713
  * 使用牛顿切割法求最近的点
@@ -9875,6 +9877,7 @@
9875
9877
  return piMod(angle);
9876
9878
  }
9877
9879
  };
9880
+
9878
9881
  function cubicAt(p0, p1, p2, p3, t) {
9879
9882
  var onet = 1 - t; // t * t * t 的性能大概是 Math.pow(t, 3) 的三倍
9880
9883
  return onet * onet * onet * p0 + 3 * p1 * t * onet * onet + 3 * p2 * t * t * onet + p3 * t * t * t;
@@ -10306,6 +10309,7 @@
10306
10309
  return piMod(Math.atan2(dy, dx));
10307
10310
  }
10308
10311
  };
10312
+
10309
10313
  function analyzePoints(points) {
10310
10314
  // 计算每段的长度和总的长度
10311
10315
  var totalLength = 0;
@@ -10418,6 +10422,7 @@
10418
10422
  }
10419
10423
  return minDistance;
10420
10424
  }
10425
+
10421
10426
  var polyline = {
10422
10427
  /**
10423
10428
  * 计算多折线的包围盒
@@ -13867,12 +13872,13 @@
13867
13872
  this.getAnimations().forEach(function (animation) {
13868
13873
  animation.cancel();
13869
13874
  });
13870
- this.renderable = null;
13871
- this.cullable = null;
13872
- this.transformable = null;
13873
- this.rBushNode = null;
13874
- this.geometry = null;
13875
- this.sortable = null;
13875
+ // FIXME
13876
+ // this.renderable = null;
13877
+ // this.cullable = null;
13878
+ // this.transformable = null;
13879
+ // this.rBushNode = null;
13880
+ // this.geometry = null;
13881
+ // this.sortable = null;
13876
13882
  };
13877
13883
  _proto.cloneNode = function cloneNode(deep, customCloneFunc) {
13878
13884
  var clonedStyle = _extends({}, this.attributes);
@@ -13919,9 +13925,12 @@
13919
13925
  // account for FCP, process properties as less as possible
13920
13926
  runtime.styleValueRegistry.processProperties(this, attributes, {
13921
13927
  forceUpdateGeometry: true,
13922
- usedAttributes:
13923
- // only Group / Text should account for text relative props
13924
- this.tagName === exports.Shape.GROUP || this.tagName === exports.Shape.TEXT ? INHERITABLE_STYLE_PROPS : INHERITABLE_BASE_STYLE_PROPS
13928
+ usedAttributes: INHERITABLE_STYLE_PROPS
13929
+ // usedAttributes:
13930
+ // // only Group / Text should account for text relative props
13931
+ // this.tagName === Shape.GROUP || this.tagName === Shape.TEXT
13932
+ // ? INHERITABLE_STYLE_PROPS
13933
+ // : INHERITABLE_BASE_STYLE_PROPS,
13925
13934
  });
13926
13935
  // redraw at next frame
13927
13936
  renderable.dirty = true;
@@ -22042,9 +22051,14 @@
22042
22051
  letterSpacing = parsedStyle.letterSpacing,
22043
22052
  _parsedStyle$maxLines = parsedStyle.maxLines,
22044
22053
  maxLines = _parsedStyle$maxLines === void 0 ? Infinity : _parsedStyle$maxLines,
22045
- textOverflow = parsedStyle.textOverflow;
22054
+ textOverflow = parsedStyle.textOverflow,
22055
+ metrics = parsedStyle.metrics;
22046
22056
  var context = this.runtime.offscreenCanvas.getOrCreateContext(offscreenCanvas);
22047
22057
  var maxWidth = wordWrapWidth + letterSpacing;
22058
+ // single line & no need to wrap
22059
+ if (maxLines === 1 && metrics.width <= maxWidth) {
22060
+ return text;
22061
+ }
22048
22062
  var ellipsis = '';
22049
22063
  if (textOverflow === 'ellipsis') {
22050
22064
  ellipsis = '...';
@@ -23132,15 +23146,17 @@
23132
23146
  if (destroyScenegraph) {
23133
23147
  // destroy Document
23134
23148
  this.document.destroy();
23149
+ this.getEventService().destroy();
23150
+ // clear rbush
23151
+ if (this.context.rBushRoot) {
23152
+ this.context.rBushRoot.clear();
23153
+ this.context.rBushRoot = null;
23154
+ }
23155
+ this.context.renderingContext.root = null;
23135
23156
  }
23136
23157
  // destroy services
23137
23158
  this.getRenderingService().destroy();
23138
23159
  this.getContextService().destroy();
23139
- this.getEventService().destroy();
23140
- // clear rbush
23141
- this.context.rBushRoot.clear();
23142
- this.context.rBushRoot = null;
23143
- this.context.renderingContext.root = null;
23144
23160
  if (!skipTriggerEvent) {
23145
23161
  this.dispatchEvent(new CustomEvent(exports.CanvasEvent.AFTER_DESTROY));
23146
23162
  }