1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:57:34 +00:00

PixelPaint: Allow selecting a custom aspect ratio for RectangleTool

If you enter a custom aspect ratio, and are not holding down shift,
the rectangle will be constrained to the entered aspect ratio
This commit is contained in:
Mustafa Quraish 2021-09-15 19:49:53 -04:00 committed by Andreas Kling
parent 6ba3fc559f
commit 090962823b
2 changed files with 37 additions and 0 deletions

View file

@ -41,12 +41,16 @@ private:
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness);
RefPtr<GUI::Widget> m_properties_widget;
RefPtr<GUI::TextBox> m_aspect_w_textbox;
RefPtr<GUI::TextBox> m_aspect_h_textbox;
GUI::MouseButton m_drawing_button { GUI::MouseButton::None };
Gfx::IntPoint m_rectangle_start_position;
Gfx::IntPoint m_rectangle_end_position;
FillMode m_fill_mode { FillMode::Outline };
DrawMode m_draw_mode { DrawMode::FromCorner };
int m_thickness { 1 };
Optional<float> m_aspect_ratio;
};
}