Skip to content

Commit

Permalink
Merge pull request #16329 from apache/fix-polar-clip
Browse files Browse the repository at this point in the history
fix(polar): fix edge symbols are clipped unexpectedly for the tiny offset.
  • Loading branch information
pissang authored Jan 6, 2022
2 parents 66fa735 + f64d1eb commit 219d3f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/coord/polar/Polar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ class Polar implements CoordinateSystem, CoordinateSystemMaster {
// Start angle and end angle don't matter
const dx = x - this.cx;
const dy = y - this.cy;
const d2 = dx * dx + dy * dy;
// minus a tiny value 1e-4 to avoid being clipped unexpectedly
const d2 = dx * dx + dy * dy - 1e-4;
const r = this.r;
const r0 = this.r0;

Expand Down Expand Up @@ -265,4 +266,4 @@ interface PolarArea extends CoordinateSystemClipArea {
clockwise: boolean
}

export default Polar;
export default Polar;
15 changes: 14 additions & 1 deletion test/clip.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 219d3f2

Please sign in to comment.