@visactor/vrender 0.12.1 → 0.12.3

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.js CHANGED
@@ -9147,7 +9147,7 @@
9147
9147
  return newNode;
9148
9148
  }
9149
9149
  insertInto(newNode, idx) {
9150
- if (this._nodeList) {
9150
+ if (!this._ignoreWarn && this._nodeList) {
9151
9151
  console.warn('insertIntoKeepIdx和insertInto混用可能会存在错误');
9152
9152
  }
9153
9153
  if (idx >= this.childrenCount) {
@@ -9215,7 +9215,10 @@
9215
9215
  if (node) {
9216
9216
  return node._next ? this.insertBefore(newNode, node._next) : this.appendChild(newNode);
9217
9217
  }
9218
- return this.insertInto(newNode, 0);
9218
+ this._ignoreWarn = true;
9219
+ const data = this.insertInto(newNode, 0);
9220
+ this._ignoreWarn = false;
9221
+ return data;
9219
9222
  }
9220
9223
  removeChild(child) {
9221
9224
  if (!this._idMap) {
@@ -22206,6 +22209,11 @@
22206
22209
  text.setAttributes(params);
22207
22210
  return text.AABBBounds;
22208
22211
  }
22212
+ const richText = createRichText({});
22213
+ function getRichTextBounds(params) {
22214
+ richText.setAttributes(params);
22215
+ return richText.AABBBounds;
22216
+ }
22209
22217
 
22210
22218
  class DefaultCanvasAllocate {
22211
22219
  pools = [];
@@ -22644,7 +22652,7 @@
22644
22652
  }
22645
22653
  const { outerRadius = arcAttribute.outerRadius, innerRadius = arcAttribute.innerRadius, cap = arcAttribute.cap, forceShowCap = arcAttribute.forceShowCap } = arc.attribute;
22646
22654
  const { isFullStroke, stroke: arrayStroke } = parseStroke(stroke);
22647
- if (doFill || isFullStroke) {
22655
+ if (doFill || isFullStroke || background) {
22648
22656
  context.beginPath();
22649
22657
  drawArcPath$1(arc, context, x, y, outerRadius, innerRadius);
22650
22658
  if (!this._arcRenderContribitions) {
@@ -28932,6 +28940,25 @@
28932
28940
  _context.setLineDash(lineDash);
28933
28941
  }
28934
28942
  }
28943
+ _setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams) {
28944
+ const _context = this.nativeContext;
28945
+ if (!defaultParams) {
28946
+ defaultParams = this.strokeAttributes;
28947
+ }
28948
+ const { strokeOpacity = defaultParams.strokeOpacity, opacity = defaultParams.opacity } = attribute;
28949
+ if (strokeOpacity > 1e-12 && opacity > 1e-12) {
28950
+ const { lineWidth = defaultParams.lineWidth, stroke = defaultParams.stroke, lineJoin = defaultParams.lineJoin, lineDash = defaultParams.lineDash, lineCap = defaultParams.lineCap, miterLimit = defaultParams.miterLimit } = attribute;
28951
+ _context.globalAlpha = strokeOpacity * opacity;
28952
+ _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr);
28953
+ _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY);
28954
+ _context.lineJoin = lineJoin;
28955
+ if (!(lineDash[0] === 0 && lineDash[1] === 0)) {
28956
+ _context.setLineDash(lineDash);
28957
+ }
28958
+ _context.lineCap = lineCap;
28959
+ _context.miterLimit = miterLimit;
28960
+ }
28961
+ }
28935
28962
  draw() {
28936
28963
  const _context = this.nativeContext;
28937
28964
  this.drawPromise = new Promise(resolve => {
@@ -33743,7 +33770,7 @@
33743
33770
  'rect'
33744
33771
  ];
33745
33772
 
33746
- const version = "0.12.1";
33773
+ const version = "0.12.3";
33747
33774
 
33748
33775
  exports.ACustomAnimate = ACustomAnimate;
33749
33776
  exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;
@@ -33985,6 +34012,7 @@
33985
34012
  exports.getContextFont = getContextFont;
33986
34013
  exports.getExtraModelMatrix = getExtraModelMatrix;
33987
34014
  exports.getModelMatrix = getModelMatrix;
34015
+ exports.getRichTextBounds = getRichTextBounds;
33988
34016
  exports.getScaledStroke = getScaledStroke;
33989
34017
  exports.getTextBounds = getTextBounds;
33990
34018
  exports.getTheme = getTheme;