summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint
diff options
context:
space:
mode:
authorMarcus Nilsson <brainbomb@gmail.com>2021-07-06 00:24:16 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-08 20:16:26 +0200
commit0900e31fe0188b5ac8e3a637b086632351088632 (patch)
tree01fcfe2dc37d1053c76c22fc77f9794749f58e03 /Userland/Applications/PixelPaint
parent618bb2d33e8bcda6ef1ebb1bd6c0a196c35fba44 (diff)
downloadserenity-0900e31fe0188b5ac8e3a637b086632351088632.zip
PixelPaint: Scroll into view when reordering layers
Make LayerListWidget scroll into view when reordering layers.
Diffstat (limited to 'Userland/Applications/PixelPaint')
-rw-r--r--Userland/Applications/PixelPaint/LayerListWidget.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/LayerListWidget.cpp b/Userland/Applications/PixelPaint/LayerListWidget.cpp
index 32a93c590c..d048f2dcd7 100644
--- a/Userland/Applications/PixelPaint/LayerListWidget.cpp
+++ b/Userland/Applications/PixelPaint/LayerListWidget.cpp
@@ -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();
}