mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:17:35 +00:00
PixelPaint: Do not change layers when scaling with the move tool
The move tool will no longer change the foreground layer if the cursor is currently hovering over a resize anchor.
This commit is contained in:
parent
51c3967516
commit
e33791502f
2 changed files with 2 additions and 1 deletions
|
@ -374,7 +374,7 @@ void ImageEditor::mousedown_event(GUI::MouseEvent& event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (auto* tool = dynamic_cast<MoveTool*>(m_active_tool); tool && tool->layer_selection_mode() == MoveTool::LayerSelectionMode::ForegroundLayer) {
|
if (auto* tool = dynamic_cast<MoveTool*>(m_active_tool); tool && tool->layer_selection_mode() == MoveTool::LayerSelectionMode::ForegroundLayer) {
|
||||||
if (auto* foreground_layer = layer_at_editor_position(event.position()))
|
if (auto* foreground_layer = layer_at_editor_position(event.position()); foreground_layer && !tool->cursor_is_within_resize_anchor())
|
||||||
set_active_layer(foreground_layer);
|
set_active_layer(foreground_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap const>> cursor() override;
|
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap const>> cursor() override;
|
||||||
virtual bool is_overriding_alt() override { return true; }
|
virtual bool is_overriding_alt() override { return true; }
|
||||||
LayerSelectionMode layer_selection_mode() const { return m_layer_selection_mode; }
|
LayerSelectionMode layer_selection_mode() const { return m_layer_selection_mode; }
|
||||||
|
bool cursor_is_within_resize_anchor() { return m_resize_anchor_location.has_value(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int resize_anchor_size(Gfx::IntRect layer_rect_in_frame_coordinates);
|
static int resize_anchor_size(Gfx::IntRect layer_rect_in_frame_coordinates);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue