mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
PixelPaint: Scroll into view when reordering layers
Make LayerListWidget scroll into view when reordering layers.
This commit is contained in:
parent
618bb2d33e
commit
0900e31fe0
Notes:
sideshowbarker
2024-07-18 10:03:21 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/0900e31fe01 Pull-request: https://github.com/SerenityOS/serenity/pull/8503 Reviewed-by: https://github.com/awesomekling
1 changed files with 5 additions and 0 deletions
|
@ -163,6 +163,11 @@ void LayerListWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
auto& gadget = m_gadgets[m_moving_gadget_index.value()];
|
||||
VERIFY(gadget.is_moving);
|
||||
gadget.movement_delta = delta;
|
||||
|
||||
auto adjusted_rect = gadget.rect;
|
||||
adjusted_rect.translate_by(gadget.movement_delta);
|
||||
scroll_into_view(adjusted_rect, false, true);
|
||||
|
||||
relayout_gadgets();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue