summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint/Tools/Tool.cpp
diff options
context:
space:
mode:
authorGal Horowitz <galush.horowitz@gmail.com>2021-10-02 20:33:01 +0300
committerAndreas Kling <kling@serenityos.org>2021-10-02 20:54:32 +0200
commitcd7473d1a36f4fb5815d9dd46d9549f49e849bb6 (patch)
treef261576140b59220dae4d26c99a8292c59657af9 /Userland/Applications/PixelPaint/Tools/Tool.cpp
parentbe4485fe85e209705fd347e02dd037ab619edb63 (diff)
downloadserenity-cd7473d1a36f4fb5815d9dd46d9549f49e849bb6.zip
PixelPaint: Correctly offset stroke position for even thicknesses
Diffstat (limited to 'Userland/Applications/PixelPaint/Tools/Tool.cpp')
-rw-r--r--Userland/Applications/PixelPaint/Tools/Tool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/PixelPaint/Tools/Tool.cpp b/Userland/Applications/PixelPaint/Tools/Tool.cpp
index 27694b9650..d1e6f9f6b2 100644
--- a/Userland/Applications/PixelPaint/Tools/Tool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/Tool.cpp
@@ -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>();
}