You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor observation: caretTimeline.play() in the newScene != null branch runs unconditionally, meaning all layers (not just the one with the caret) briefly start their timeline on scene attachment. This is harmless in practice because setCaretVisibility gates on !caretShape.getElements().isEmpty() (making the animation frames no-ops), and updateCaretPosition() will quickly stop the timeline for non-caret layers. A slightly more precise version would
guard with if (hasCaret()) before playing, but it's not worth complicating the fix for.
Minor observation: caretTimeline.play() in the newScene != null branch runs unconditionally, meaning all layers (not just the one with the caret) briefly start their timeline on scene attachment. This is harmless in practice because setCaretVisibility gates on !caretShape.getElements().isEmpty() (making the animation frames no-ops), and updateCaretPosition() will quickly stop the timeline for non-caret layers. A slightly more precise version would guard with if (hasCaret()) before playing, but it's not worth complicating the fix for.
Good remark.
I added the hasCaret() check. It is a non-intrusive say check, and I believe it's the right thing to do. I'm not sure about the cost (including object creation) of starting a timeline (even without actions). Since this code runs on the FX thread, every single instruction counts.
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
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.
Stop timeline (and remove it from the GC root) when the ParagraphTile is removed from the scenegraph