oolong-engine 0.0.2-t.4 → 0.0.2-t.6

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/engine.js CHANGED
@@ -6361,7 +6361,7 @@ class yl {
6361
6361
  acrPolyDraw(t, e) {
6362
6362
  const n = e[e.length - 1], o = this.dealArcPoly(e);
6363
6363
  for (const s of o)
6364
- t.moveTo(s.p0.x, s.p0.y), t.lineTo(s.p1.x, s.p1.y), t.arcTo(s.arcDraw.a.x, s.arcDraw.a.y, s.arcDraw.b.x, s.arcDraw.b.y, s.arcDraw.r);
6364
+ t.moveTo(s.p0.x, s.p0.y), t.lineTo(s.p1.x, s.p1.y), s.arcDraw.r > 1 && Number.isFinite(s.arcDraw.r) ? t.arcTo(s.arcDraw.a.x, s.arcDraw.a.y, s.arcDraw.b.x, s.arcDraw.b.y, s.arcDraw.r) : t.lineTo(s.arcDraw.b.x, s.arcDraw.b.y);
6365
6365
  t.lineTo(n.x, n.y), t.stroke();
6366
6366
  }
6367
6367
  dealArcPoly(t) {
@@ -18515,6 +18515,8 @@ class rf extends Tn {
18515
18515
  const n = e.borderProps;
18516
18516
  t.fillStyle = n.color, t.strokeStyle = n.color, t.lineWidth = n.width, t.globalAlpha = n.alpha;
18517
18517
  const o = Math.min(Ee, Ne) * 0.3;
18518
+ if (o <= 0 || !Number.isFinite(o))
18519
+ return;
18518
18520
  t.moveTo(0, 0.5 * Ne), t.lineTo(Ee - o, 0.5 * Ne), t.stroke(), t.beginPath();
18519
18521
  const s = Ee, r = 0.5 * Ne;
18520
18522
  t.arc(s, r, o, 0, 2 * Math.PI), t.fill(), t.stroke();
@@ -18525,6 +18527,8 @@ class af extends Tn {
18525
18527
  const n = e.borderProps;
18526
18528
  t.strokeStyle = n.color, t.lineWidth = 2, t.globalAlpha = n.alpha;
18527
18529
  const o = Math.min(Ee, Ne) * 0.3;
18530
+ if (o <= 0 || !Number.isFinite(o))
18531
+ return;
18528
18532
  t.moveTo(0, 0.5 * Ne), t.lineTo(Ee - o, 0.5 * Ne), t.stroke(), t.beginPath();
18529
18533
  const s = Ee, r = 0.5 * Ne;
18530
18534
  t.arc(s, r, o, 0, 2 * Math.PI), t.stroke();
@@ -18949,7 +18953,7 @@ class df extends bt {
18949
18953
  class uf extends bt {
18950
18954
  draw(t, e) {
18951
18955
  const n = t.baseProps, o = t.colorProps, s = t.borderProps;
18952
- e.beginPath(), e.fillStyle = o.color, e.roundRect(0, 0, n.width, n.height, 10), o.color !== "" && (e.globalAlpha = o.alpha, e.fill()), s.color !== "" && s.dashType !== ot.None && Math.abs(s.alpha) > 1e-3 && (e.strokeStyle = s.color, e.lineWidth = s.width, e.globalAlpha = s.alpha, M.setDashLine(s, e), e.stroke());
18956
+ n.width <= 0 || n.height <= 0 || !Number.isFinite(n.width) || !Number.isFinite(n.height) || (e.beginPath(), e.fillStyle = o.color, e.roundRect(0, 0, n.width, n.height, 10), o.color !== "" && (e.globalAlpha = o.alpha, e.fill()), s.color !== "" && s.dashType !== ot.None && Math.abs(s.alpha) > 1e-3 && (e.strokeStyle = s.color, e.lineWidth = s.width, e.globalAlpha = s.alpha, M.setDashLine(s, e), e.stroke()));
18953
18957
  }
18954
18958
  nodeShapeInfo(t) {
18955
18959
  const { width: e, height: n } = t.baseProps;
@@ -18959,7 +18963,7 @@ class uf extends bt {
18959
18963
  class pf extends bt {
18960
18964
  draw(t, e) {
18961
18965
  const n = t.colorProps, { width: o, height: s } = t.baseProps, r = t.borderProps;
18962
- e.fillStyle = n.color, e.globalAlpha = n.alpha, e.lineWidth = r.width, e.lineJoin = "round", e.lineCap = "round", e.beginPath(), e.ellipse(0.5 * o, 0.5 * s, 0.5 * o, 0.5 * s, 0, 0, 2 * Math.PI, !1), n.color !== "" && e.fill(), r.color !== "" && r.dashType !== ot.None && Math.abs(r.alpha) > 1e-3 && (e.strokeStyle = r.color, e.globalAlpha = r.alpha, M.setDashLine(r, e), e.stroke());
18966
+ o <= 0 || s <= 0 || !Number.isFinite(o) || !Number.isFinite(s) || (e.fillStyle = n.color, e.globalAlpha = n.alpha, e.lineWidth = r.width, e.lineJoin = "round", e.lineCap = "round", e.beginPath(), e.ellipse(0.5 * o, 0.5 * s, 0.5 * o, 0.5 * s, 0, 0, 2 * Math.PI, !1), n.color !== "" && e.fill(), r.color !== "" && r.dashType !== ot.None && Math.abs(r.alpha) > 1e-3 && (e.strokeStyle = r.color, e.globalAlpha = r.alpha, M.setDashLine(r, e), e.stroke()));
18963
18967
  }
18964
18968
  textContentBounds(t) {
18965
18969
  const e = t.baseProps, n = e.width * Math.sqrt(2) / 2, o = (e.width - n) / 2, s = Math.max(e.width, e.height) / 2, r = Math.min(e.width, e.height) / 2, i = (1 - (n / 2) ** 2 / s ** 2) * r ** 2, a = {