mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
PixelPaint: Correctly offset stroke position for even thicknesses
This commit is contained in:
parent
be4485fe85
commit
cd7473d1a3
Notes:
sideshowbarker
2024-07-18 03:12:12 +09:00
Author: https://github.com/GalHorowitz
Commit: cd7473d1a3
Pull-request: https://github.com/SerenityOS/serenity/pull/10314
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ void Tool::on_keydown(GUI::KeyEvent& event)
|
|||
Gfx::IntPoint Tool::editor_stroke_position(Gfx::IntPoint const& pixel_coords, int stroke_thickness) const
|
||||
{
|
||||
auto position = m_editor->image_position_to_editor_position(pixel_coords);
|
||||
auto offset = (stroke_thickness % 2 == 0) ? m_editor->scale() : m_editor->scale() / 2;
|
||||
auto offset = (stroke_thickness % 2 == 0) ? 0 : m_editor->scale() / 2;
|
||||
position = position.translated(offset, offset);
|
||||
return position.to_type<int>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue