From 8fa6a851005579e9b686f8d4aba9be3a084bf483 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 22 Jan 2023 17:52:49 +0000 Subject: [PATCH] PixelPaint: Scale the clone tool sample marker size with zoom level --- Userland/Applications/PixelPaint/Tools/CloneTool.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp index d249aa8212..2e823a1479 100644 --- a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp @@ -176,15 +176,14 @@ Optional CloneTool::sample_marker_rect() if (!m_sample_location.has_value()) return {}; - auto sample_pos = m_editor->content_to_frame_position(m_sample_location.value()); - // We don't want the marker to be a single pixel and hide the color. auto offset = AK::max(2, size() / 2); - return Gfx::IntRect { - (int)sample_pos.x() - offset, - (int)sample_pos.y() - offset, + Gfx::IntRect content_rect = { + m_sample_location.value().x() - offset, + m_sample_location.value().y() - offset, offset * 2, offset * 2 }; + return m_editor->content_to_frame_rect(content_rect).to_type(); } void CloneTool::update_sample_marker(Optional old_rect)