mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 02:56:10 +00:00
PixelPaint: Don't allow the move tool to resize to zero pixels
This prevents an error message appearing when we attempt to scale a layer to zero pixels using the move tool.
This commit is contained in:
parent
037744e62a
commit
569ef94228
Notes:
sideshowbarker
2024-07-17 01:45:45 +09:00
Author: https://github.com/tcl3
Commit: 569ef94228
Pull-request: https://github.com/SerenityOS/serenity/pull/16984
Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 1 deletions
|
@ -93,7 +93,10 @@ void MoveTool::on_mousemove(Layer* layer, MouseEvent& event)
|
|||
auto aspect_ratio = m_layer_being_moved->size().aspect_ratio();
|
||||
scaling_origin = opposite_corner.end_point_for_aspect_ratio(scaling_origin, aspect_ratio);
|
||||
}
|
||||
m_new_layer_rect = Gfx::IntRect::from_two_points(scaling_origin, opposite_corner);
|
||||
|
||||
auto scaled_rect = Gfx::IntRect::from_two_points(scaling_origin, opposite_corner);
|
||||
if (!scaled_rect.is_empty())
|
||||
m_new_layer_rect = scaled_rect;
|
||||
} else {
|
||||
m_layer_being_moved->set_location(m_layer_origin.translated(delta));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue