Skip to content

Commit

Permalink
fix: 修复 The polar coord clip should include center point in scatter
Browse files Browse the repository at this point in the history
  • Loading branch information
sz-p committed Sep 25, 2024
1 parent b0ef6c8 commit 80438d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/coord/polar/Polar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
};
}
Expand Down

0 comments on commit 80438d2

Please sign in to comment.