From 4b604f702eaa81d94a39f90577588f9852c10444 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Thu, 2 Feb 2023 19:03:33 +0000 Subject: [PATCH] PixelPaint: Correct move tool alignment with the layer boundary Previously, the move tool outline could "wobble" relative to the layer boundary. This caused the layer boundary to appear and disappear when zooming. With this commit, the layer boundary is always drawn behind the move tool outline. --- Userland/Applications/PixelPaint/Tools/MoveTool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp index 16f8aa9e06..acbe1d8618 100644 --- a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp @@ -195,7 +195,7 @@ void MoveTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event) GUI::Painter painter(*m_editor); painter.add_clip_rect(event.rect()); auto content_rect = m_scaling ? m_new_layer_rect : m_editor->active_layer()->relative_rect(); - auto rect_in_editor = m_editor->content_to_frame_rect(content_rect).to_rounded(); + auto rect_in_editor = m_editor->content_to_frame_rect(content_rect).to_type(); if (m_scaling && (!m_cached_preview_bitmap.is_null() || !update_cached_preview_bitmap(layer).is_error())) { Gfx::PainterStateSaver saver(painter); painter.add_clip_rect(m_editor->content_rect()); @@ -255,7 +255,7 @@ ErrorOr MoveTool::update_cached_preview_bitmap(Layer const* layer) Optional MoveTool::resize_anchor_location_from_cursor_position(Layer const* layer, MouseEvent& event) { - auto layer_rect = m_editor->content_to_frame_rect(layer->relative_rect()).to_rounded(); + auto layer_rect = m_editor->content_to_frame_rect(layer->relative_rect()).to_type(); auto size = max(resize_anchor_min_size, resize_anchor_size(layer_rect)); auto cursor_within_resize_anchor_rect = [&event, size](Gfx::IntPoint layer_position_in_frame_coordinates) {