V
V
VegasChickiChicki2018-12-30 19:11:10
JavaScript
VegasChickiChicki, 2018-12-30 19:11:10

How to fix this and what is it all about?

I can’t understand why this is happening, I draw a line in the canvas, if it is done statically, just draw it, then it is “normal”, if the same line is drawn dynamically, as I tried to do, then it is somehow “twitchy” /pixel". I can't figure out what it is, maybe it's only on my monitor that it's displayed like this...
Here is the code:
https://codepen.io/Poporo35/pen/oJobQj
Here is a screenshot with zoom:
5c28edfaa6a7d939190702.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
krokodily, 2018-12-30
@VegasChickiChicki

You need to clear the canvas before redrawing. Now each new line is superimposed on the previous one and anti-aliasing stops working correctly.

G
grinat, 2018-12-30
@grinat

Duck canvas is a stupid picture, so that it is not twitchy, svg is needed.
https://github.com/gliffy/canvas2svg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question