Repository navigation
Add a trail option for fading lines - #31
Open
jorgenbruntveit wants to merge 1 commit into
Open
jorgenbruntveit wants to merge 1 commit into
jorgenbruntveit wants to merge 1 commit into
Conversation
"Trail behind the pen" erases each line from its start while you draw, at a steady speed, so long lines take longer to go than short ones. When it is selected, Settings shows when erasing starts and how fast it runs.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a fifth choice to Settings → Drawing → Lines fade: Trail behind the pen.
What it does
Instead of the whole line fading after a few seconds, an eraser follows the line from where it started, so the line disappears behind the pen while you keep drawing. The eraser moves at a steady speed along the line, so a long line takes longer to go than a short one, however fast it was drawn. Anything drawn within the start delay is never erased, so the end you are drawing stays visible. After you release, the rest of the line is erased at the same speed.
When the option is selected, two more rows appear:
Both are cleared by Reset like the other settings. Existing choices behave as before.
How
strokeStarton the line'sCAShapeLayer, so the line is erased smoothly along its exact shape. Removing points from the start instead made the line jump and slightly change shape as it shrank.strokeStartanimation, and the layer is removed when it finishes.fadeSeconds = -1, so the other values keep their meaning.keepnow checks for0exactly instead of<= 0.Testing
Built locally and tested on macOS 27.3 with short and long lines, drawn fast and slowly, at different start and speed settings. The pointer and drawing behave as before with the other fade choices.
This touches the same picker as #27, so whichever lands second will need a small merge there.