mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
PixelPaint: Don't hit test non-visible layers
This commit is contained in:
parent
b560445c84
commit
3a4351b2b5
1 changed files with 2 additions and 0 deletions
|
@ -338,6 +338,8 @@ Layer* ImageEditor::layer_at_editor_position(const Gfx::IntPoint& editor_positio
|
||||||
auto image_position = editor_position_to_image_position(editor_position);
|
auto image_position = editor_position_to_image_position(editor_position);
|
||||||
for (ssize_t i = m_image->layer_count() - 1; i >= 0; --i) {
|
for (ssize_t i = m_image->layer_count() - 1; i >= 0; --i) {
|
||||||
auto& layer = m_image->layer(i);
|
auto& layer = m_image->layer(i);
|
||||||
|
if (!layer.is_visible())
|
||||||
|
continue;
|
||||||
if (layer.relative_rect().contains(Gfx::IntPoint(image_position.x(), image_position.y())))
|
if (layer.relative_rect().contains(Gfx::IntPoint(image_position.x(), image_position.y())))
|
||||||
return const_cast<Layer*>(&layer);
|
return const_cast<Layer*>(&layer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue