mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:37:44 +00:00
PixelPaint: Make move_selection() cycle through layers
Previously move_selection() did not work as expected. Instead store the selected layer index in a member variable and continue to cycle through the layers when you come to the start/end. Also use it to scroll into view. Lastly rename the function to cycle_through_selection() to make it clearer what it does.
This commit is contained in:
parent
8d205ae62e
commit
e1906d74b8
3 changed files with 23 additions and 6 deletions
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
void select_bottom_layer();
|
||||
void select_top_layer();
|
||||
void move_selection(int delta);
|
||||
void cycle_through_selection(int delta);
|
||||
|
||||
private:
|
||||
explicit LayerListWidget();
|
||||
|
@ -66,6 +66,8 @@ private:
|
|||
|
||||
Optional<size_t> m_moving_gadget_index;
|
||||
Gfx::IntPoint m_moving_event_origin;
|
||||
|
||||
size_t m_selected_layer_index { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue