From 80438d224e55d7e0ce6f542af6574aa6a0878d3b Mon Sep 17 00:00:00 2001 From: sz-p Date: Wed, 25 Sep 2024 20:02:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20The=20polar=20coord?= =?UTF-8?q?=20clip=20should=20include=20center=20point=20in=20scatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coord/polar/Polar.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coord/polar/Polar.ts b/src/coord/polar/Polar.ts index 43f63a75f4..b34d0a8f92 100644 --- a/src/coord/polar/Polar.ts +++ b/src/coord/polar/Polar.ts @@ -214,7 +214,7 @@ class Polar implements CoordinateSystem, CoordinateSystemMaster { const angleExtent = angleAxis.getExtent(); const RADIAN = Math.PI / 180; - + const EPSILON = 1e-4; return { cx: this.cx, cy: this.cy, @@ -233,7 +233,8 @@ class Polar implements CoordinateSystem, CoordinateSystemMaster { const r0 = this.r0; // minus a tiny value 1e-4 in double side to avoid being clipped unexpectedly - return (d2 - 1e-4) <= r * r && (d2 + 1e-4) >= r0 * r0; + // r == r0 contain nothing + return r !== r0 && (d2 - EPSILON) <= r * r && (d2 + EPSILON) >= r0 * r0; } }; }