@visactor/vrender 0.11.0 → 0.11.1-alpha.1

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
@@ -7659,6 +7659,7 @@
7659
7659
  ...DefaultAttribute,
7660
7660
  width: 0,
7661
7661
  height: 0,
7662
+ strokeBoundsBuffer: 0,
7662
7663
  cornerRadius: 0
7663
7664
  };
7664
7665
  const DefaultRect3dAttribute = {
@@ -16076,8 +16077,8 @@
16076
16077
  });
16077
16078
  await Promise.all(promiseList);
16078
16079
  }
16079
- function boundStroke(bounds, length, miter, pad = 0) {
16080
- bounds.expand(length + pad + (miter ? miterAdjustment(miter, length) : 0));
16080
+ function boundStroke(bounds, halfW, miter, pad = 0) {
16081
+ bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0)));
16081
16082
  return bounds;
16082
16083
  }
16083
16084
  function miterAdjustment(miter, strokeWidth) {
@@ -21492,7 +21493,7 @@
21492
21493
  aabbBounds.union(tb1);
21493
21494
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
21494
21495
  });
21495
- this.transformAABBBounds(attribute, aabbBounds, rectTheme, graphic);
21496
+ this.transformAABBBounds(attribute, aabbBounds, rectTheme, false, graphic);
21496
21497
  return aabbBounds;
21497
21498
  }
21498
21499
  updateGroupAABBBounds(attribute, groupTheme, aabbBounds, graphic) {
@@ -21514,7 +21515,7 @@
21514
21515
  const tb2 = this.tempAABBBounds2;
21515
21516
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21516
21517
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21517
- this.transformAABBBounds(attribute, aabbBounds, groupTheme, graphic);
21518
+ this.transformAABBBounds(attribute, aabbBounds, groupTheme, false, graphic);
21518
21519
  return aabbBounds;
21519
21520
  }
21520
21521
  updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
@@ -21569,7 +21570,7 @@
21569
21570
  const tb2 = this.tempAABBBounds2;
21570
21571
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21571
21572
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21572
- this.transformAABBBounds(attribute, aabbBounds, richtextTheme, graphic);
21573
+ this.transformAABBBounds(attribute, aabbBounds, richtextTheme, false, graphic);
21573
21574
  return aabbBounds;
21574
21575
  }
21575
21576
  updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
@@ -21607,7 +21608,8 @@
21607
21608
  aabbBounds.union(tb1);
21608
21609
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
21609
21610
  });
21610
- this.transformAABBBounds(attribute, aabbBounds, pathTheme, graphic);
21611
+ const { lineJoin = pathTheme.lineJoin } = attribute;
21612
+ this.transformAABBBounds(attribute, aabbBounds, pathTheme, lineJoin === 'miter', graphic);
21611
21613
  return aabbBounds;
21612
21614
  }
21613
21615
  updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic) {
@@ -21636,7 +21638,7 @@
21636
21638
  const tb2 = this.tempAABBBounds2;
21637
21639
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21638
21640
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21639
- this.transformAABBBounds(attribute, aabbBounds, polygonTheme, graphic);
21641
+ this.transformAABBBounds(attribute, aabbBounds, polygonTheme, false, graphic);
21640
21642
  return aabbBounds;
21641
21643
  }
21642
21644
  updateArc3dAABBBounds(attribute, arcTheme, aabbBounds, graphic) {
@@ -21654,7 +21656,7 @@
21654
21656
  const tb2 = this.tempAABBBounds2;
21655
21657
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21656
21658
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21657
- this.transformAABBBounds(attribute, aabbBounds, arcTheme, graphic);
21659
+ this.transformAABBBounds(attribute, aabbBounds, arcTheme, false, graphic);
21658
21660
  return aabbBounds;
21659
21661
  }
21660
21662
  updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
@@ -21665,7 +21667,8 @@
21665
21667
  const tb2 = this.tempAABBBounds2;
21666
21668
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21667
21669
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21668
- this.transformAABBBounds(attribute, aabbBounds, polygonTheme, graphic);
21670
+ const { lineJoin = polygonTheme.lineJoin } = attribute;
21671
+ this.transformAABBBounds(attribute, aabbBounds, polygonTheme, lineJoin === 'miter', graphic);
21669
21672
  return aabbBounds;
21670
21673
  }
21671
21674
  updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic) {
@@ -21685,7 +21688,8 @@
21685
21688
  const tb2 = this.tempAABBBounds2;
21686
21689
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21687
21690
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21688
- this.transformAABBBounds(attribute, aabbBounds, lineTheme, graphic);
21691
+ const { lineJoin = lineTheme.lineJoin } = attribute;
21692
+ this.transformAABBBounds(attribute, aabbBounds, lineTheme, lineJoin === 'miter', graphic);
21689
21693
  return aabbBounds;
21690
21694
  }
21691
21695
  updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic) {
@@ -21716,7 +21720,8 @@
21716
21720
  const tb2 = this.tempAABBBounds2;
21717
21721
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21718
21722
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21719
- this.transformAABBBounds(attribute, aabbBounds, areaTheme, graphic);
21723
+ const { lineJoin = areaTheme.lineJoin } = attribute;
21724
+ this.transformAABBBounds(attribute, aabbBounds, areaTheme, lineJoin === 'miter', graphic);
21720
21725
  return aabbBounds;
21721
21726
  }
21722
21727
  updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic) {
@@ -21758,7 +21763,7 @@
21758
21763
  aabbBounds.union(tb1);
21759
21764
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
21760
21765
  });
21761
- this.transformAABBBounds(attribute, aabbBounds, circleTheme, graphic);
21766
+ this.transformAABBBounds(attribute, aabbBounds, circleTheme, false, graphic);
21762
21767
  return aabbBounds;
21763
21768
  }
21764
21769
  updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) {
@@ -21795,7 +21800,8 @@
21795
21800
  aabbBounds.union(tb1);
21796
21801
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
21797
21802
  });
21798
- this.transformAABBBounds(attribute, aabbBounds, arcTheme, graphic);
21803
+ const { lineJoin = arcTheme.lineJoin } = attribute;
21804
+ this.transformAABBBounds(attribute, aabbBounds, arcTheme, lineJoin === 'miter', graphic);
21799
21805
  return aabbBounds;
21800
21806
  }
21801
21807
  updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) {
@@ -21836,7 +21842,8 @@
21836
21842
  aabbBounds.union(tb1);
21837
21843
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
21838
21844
  });
21839
- this.transformAABBBounds(attribute, aabbBounds, symbolTheme, graphic);
21845
+ const { lineJoin = symbolTheme.lineJoin } = attribute;
21846
+ this.transformAABBBounds(attribute, aabbBounds, symbolTheme, lineJoin === 'miter', graphic);
21840
21847
  return aabbBounds;
21841
21848
  }
21842
21849
  updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) {
@@ -21868,7 +21875,7 @@
21868
21875
  const tb2 = this.tempAABBBounds2;
21869
21876
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21870
21877
  tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
21871
- this.transformAABBBounds(attribute, aabbBounds, imageTheme, graphic);
21878
+ this.transformAABBBounds(attribute, aabbBounds, imageTheme, false, graphic);
21872
21879
  return aabbBounds;
21873
21880
  }
21874
21881
  combindShadowAABBBounds(bounds, graphic) {
@@ -21877,19 +21884,19 @@
21877
21884
  bounds.union(b);
21878
21885
  }
21879
21886
  }
21880
- transformAABBBounds(attribute, aabbBounds, theme, graphic) {
21881
- const { scaleX = theme.scaleX, scaleY = theme.scaleY, stroke = theme.stroke, shadowBlur = theme.shadowBlur, lineWidth = theme.lineWidth, lineJoin = theme.lineJoin, strokeBoundsBuffer = theme.strokeBoundsBuffer } = attribute;
21887
+ transformAABBBounds(attribute, aabbBounds, theme, miter, graphic) {
21888
+ const { scaleX = theme.scaleX, scaleY = theme.scaleY, stroke = theme.stroke, shadowBlur = theme.shadowBlur, lineWidth = theme.lineWidth, strokeBoundsBuffer = theme.strokeBoundsBuffer } = attribute;
21882
21889
  const tb1 = this.tempAABBBounds1;
21883
21890
  const tb2 = this.tempAABBBounds2;
21884
21891
  if (stroke) {
21885
21892
  const scaledHalfLineWidth = lineWidth / Math.abs(scaleX + scaleY);
21886
- boundStroke(tb1, scaledHalfLineWidth, lineJoin === 'miter', strokeBoundsBuffer);
21893
+ boundStroke(tb1, scaledHalfLineWidth, miter, strokeBoundsBuffer);
21887
21894
  aabbBounds.union(tb1);
21888
21895
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
21889
21896
  }
21890
21897
  if (shadowBlur) {
21891
21898
  const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
21892
- boundStroke(tb1, shadowBlurHalfWidth, lineJoin === 'miter', strokeBoundsBuffer);
21899
+ boundStroke(tb1, shadowBlurHalfWidth, miter, strokeBoundsBuffer);
21893
21900
  aabbBounds.union(tb1);
21894
21901
  }
21895
21902
  this.combindShadowAABBBounds(aabbBounds, graphic);
@@ -33634,7 +33641,7 @@
33634
33641
  return new Stage(params);
33635
33642
  }
33636
33643
 
33637
- const version = "0.11.0";
33644
+ const version = "0.11.1-alpha.1";
33638
33645
 
33639
33646
  exports.ACustomAnimate = ACustomAnimate;
33640
33647
  exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;