summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorMustafa Quraish <mustafaq9@gmail.com>2021-09-06 20:48:08 -0400
committerAndreas Kling <kling@serenityos.org>2021-09-07 16:53:40 +0200
commit603d3a5dc61886df348040654a61b357d50ac5fd (patch)
tree8f3567fd7e442353ddef3657108d276a697adcb8 /Userland
parent0a9c64a4f57a548589aeeb94a351d86bbe373394 (diff)
downloadserenity-603d3a5dc61886df348040654a61b357d50ac5fd.zip
PixelPaint: Use correct thickness in `LineTool::on_second_paint()`
Previously, we were ignoring the scale of the editor in the second paint step. If you were zoomed in, the size while you were drawing was not the same as the size of the final shape.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/PixelPaint/LineTool.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Applications/PixelPaint/LineTool.cpp b/Userland/Applications/PixelPaint/LineTool.cpp
index 942056e3aa..e73b5b2091 100644
--- a/Userland/Applications/PixelPaint/LineTool.cpp
+++ b/Userland/Applications/PixelPaint/LineTool.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2021, Mustafa Quraish <mustafa@cs.toronto.edu>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -100,7 +101,7 @@ void LineTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event)
painter.add_clip_rect(event.rect());
auto preview_start = m_editor->layer_position_to_editor_position(*layer, m_line_start_position).to_type<int>();
auto preview_end = m_editor->layer_position_to_editor_position(*layer, m_line_end_position).to_type<int>();
- painter.draw_line(preview_start, preview_end, m_editor->color_for(m_drawing_button), m_thickness);
+ painter.draw_line(preview_start, preview_end, m_editor->color_for(m_drawing_button), m_thickness * m_editor->scale());
}
void LineTool::on_keydown(GUI::KeyEvent& event)