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.
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.
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.
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.
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.