Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anti-alias not work #15

Open
arpeggiozz opened this issue Jul 23, 2017 · 0 comments
Open

anti-alias not work #15

arpeggiozz opened this issue Jul 23, 2017 · 0 comments

Comments

@arpeggiozz
Copy link

arpeggiozz commented Jul 23, 2017

Here is my code:

var canvas = document.getElementById("canvas_circle_spec");
var context = canvas.getContext("2d");
context.strokeStyle = "#d90000";
context.save();
context.beginPath();
context.arc(64, 64, 50, 0, 2 * Math.PI, false);
context.lineWidth = 10;
context.stroke();
context.closePath();
context.restore();

context.fillStyle = "#d90000";
context.fillFlood(0, 0, 128);
context.fillFlood(64, 64, 128);

Basically, I draw a circle, and fill outside then inside. I assume it should be all red, but there are creepy zigzag along the circle. I got stuck. I guess it's about anti-alias stuff, and I read about the tolerance part, but still not work. Can it be done, and any recommended further reading? Thanks.
Codepen demo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant