-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix antialiasing problems when drawing partial strokes
When a line segment is appended to the current stroke, we used to just draw the new line segment on top of the previous picture. Due to antialiasing, this is gives a different result than drawing the entire path at the same time: For example, corners of the path are drawn twice (and therefore twice as dark) with our method. To solve this issue and maintain reasonable efficiency, we keep two pictures for each layer: The first picture (A) contains only the strokes that have been finished. The second picture (B) also contains the stroke that is currently being drawn. When a line segment is added, we reset the contents of (B) inside the bounding box of the line segment to the corresponding contents of (A). We then draw the entire current stroke on (B), clipped to this bounding box.
- Loading branch information
Showing
3 changed files
with
174 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters