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

PixelPaint: Hold shift to constrain polygonal select tool line angle

Holding shift while using the polygonal select tool now constrains the
line angle in 22.5 degree increments. This matches the behavior of the
line tool.
This commit is contained in:
Tim Ledbetter 2023-01-12 19:49:03 +00:00 committed by Jelle Raaijmakers
parent 569ef94228
commit ecc202c59d
4 changed files with 27 additions and 19 deletions

View file

@ -95,6 +95,8 @@ protected:
void set_primary_slider(GUI::ValueSlider* primary) { m_primary_slider = primary; }
void set_secondary_slider(GUI::ValueSlider* secondary) { m_secondary_slider = secondary; }
static Gfx::IntPoint constrain_line_angle(Gfx::IntPoint start_pos, Gfx::IntPoint end_pos, float angle_increment = M_PI / 8);
GUI::ValueSlider* m_primary_slider { nullptr };
GUI::ValueSlider* m_secondary_slider { nullptr };
};