-
Notifications
You must be signed in to change notification settings - Fork 332
Add animation to the selection outline #1829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add animation to the selection outline #1829
Conversation
28a69c2 to
23a6979
Compare
23a6979 to
d8e4964
Compare
| int maxY = int.MinValue; | ||
| bool hasPoint = false; | ||
|
|
||
| foreach (var polygon in document.Selection.SelectionPolygons) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this use DocumentSelection.GetBounds() to reuse some existing code? There are also some methods on the rectangle classes for inflating with padding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, that simplifies the function a lot, thanks for pointing that out
| document.Workspace.CanvasInvalidated += OnCanvasInvalidated; | ||
|
|
||
| // Timer for selection outline animation | ||
| selection_animation_timer_id = GLib.Functions.TimeoutAdd (GLib.Constants.PRIORITY_DEFAULT, 80, SelectionAnimationTick); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have multiple tabs open, is the timer tick going to cause any wasteful work / redrawing for the tabs that aren't being shown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to do some tests to check if the having many tabs open with active selections slowed down the process, but it was pretty inconclusive. I wonder if GTK doesn't redraw the invalidated area because it knows it's not rendered.
Still, I added an extra check to make the tick do nothing on non-active tabs, just in case.
|
Thanks! Those changes look good to me 👍 |
This adds an animation to the selection outline, shifting the outline to the right to give a rotating look.
This should close #1521.