Fix arc border with circumference over 2*PI#6215
Conversation
src/elements/element.arc.js
Outdated
|
|
||
| ctx.fillStyle = vm.backgroundColor; | ||
|
|
||
| if (vm.circumference > Math.PI * 2) { |
There was a problem hiding this comment.
Looks good in case 0 <= circumference <= 2*PI and 2*PI < circumference <= 4*PI, but appearance is not consistent when circumference > 4*PI. How about looping this part (endAngle - startAngle) / (Math.PI * 2) times?
There was a problem hiding this comment.
Loop implemented, did some more refactoring to keep CC (and me) happy 😄
Demo updated.
There was a problem hiding this comment.
Instead of a loop would doing % 2PI be more efficient?
There was a problem hiding this comment.
@etimberg that was my initial approach, but with transparency it is not consistent with circumference > 4*PI.
Not sure if anyone is going to use circumference that high anyway, but now its drawn consistently.
|
Fixed drawing of borders. But in 2 steps instead of 3, first fully open full circles and then fully closed partial. |




Fixes: #6171
Demo