mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:37:45 +00:00
PixelPaint: Add new selection moving modes
If you press "spacebar" while moving a selection, it will now move the origin point of the selection; and if you press "control" it will move it relatively to the center.
This commit is contained in:
parent
e2215cc0e1
commit
90873781c1
2 changed files with 33 additions and 0 deletions
|
@ -18,10 +18,19 @@ public:
|
|||
virtual void on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
||||
virtual void on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
||||
virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) override;
|
||||
virtual void on_keydown(GUI::KeyEvent&) override;
|
||||
virtual void on_keyup(GUI::KeyEvent&) override;
|
||||
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
|
||||
|
||||
private:
|
||||
enum class MovingMode {
|
||||
MovingOrigin,
|
||||
AroundCenter,
|
||||
None,
|
||||
};
|
||||
|
||||
bool m_selecting { false };
|
||||
MovingMode m_moving_mode { MovingMode::None };
|
||||
Gfx::IntPoint m_selection_start;
|
||||
Gfx::IntPoint m_selection_end;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue