Smooth line
Opened this issue · 4 comments
Sketch is choppy, any way to smooth out drawing lines
yeah! sketch got choppy when I switched from redrawing the whole frame into redrawing the minimum rectangle of the area needing to be redrawn (will refer to it as dirty region as of now). It improved performance a bunch but it resulted in the choppy lines you are talking about. I am trying to find a way to have both (or a middle ground) but i don't have much time to concentrate on this as i am taking a lot of classes this semester.
If you don't care as much about the performance upgrades, you can take out the part regarding only redrawing the dirty area and it should be fine.
Thanks for the good library and quick response. one additional note is when repeatly draw cycle very quickly, the un-smooth problem stand out the most.
How do I disable the redrawing dirty area?
No problem!
I am sorry but I can't get into details right now (I have an interview tomorrow morning, and two midterms in 3 days as well as a project on monday. You can probably even keep the code that redraws the dirty area and tinker around with connecting points in a curve instead of a line (see https://en.wikipedia.org/wiki/Bézier_curve)
Some other resources i recommend looking into are connecting points on a canvas, Spline interpolation (this is probably the best way to go, google "spline interpolation canvas" or stuff like that if you don't have the mathematical foundation for it)
I wish i can help more right now but I am extremely busy.
Regards
We're now using Bezier curves. This issue is fixed.