1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

PixelPaint: Add scaling function to move tool

This patch adds scaling function to the move tool.
When the cursor is over the lower right corner of the layer, it changes.
This is to signify that the layer can be scaled by dragging the mouse.

There is currently no preview of the scaling.
Doing a resize every time the mouse moves leads to unexpected behavior.
This commit is contained in:
Tommaso Peduzzi 2022-08-08 14:34:50 +02:00 committed by Andreas Kling
parent 77f124c87a
commit 293ab2cdc9
2 changed files with 36 additions and 3 deletions

View file

@ -21,7 +21,7 @@ public:
virtual void on_mousemove(Layer*, MouseEvent&) override;
virtual void on_mouseup(Layer*, MouseEvent&) override;
virtual void on_keydown(GUI::KeyEvent&) override;
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Move; }
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override;
private:
virtual StringView tool_name() const override { return "Move Tool"sv; }
@ -29,6 +29,8 @@ private:
RefPtr<Layer> m_layer_being_moved;
Gfx::IntPoint m_event_origin;
Gfx::IntPoint m_layer_origin;
bool m_scaling { false };
bool m_mouse_in_resize_corner { false };
};
}