diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-23 20:35:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-23 20:36:07 +0200 |
commit | 3a4351b2b5e30bdffe9e34e143fd15af67cec68f (patch) | |
tree | 937d26dcf66f51749979170929b8ef34399443ce | |
parent | b560445c842bf67d9ac8d7550a051fe62ec88ba7 (diff) | |
download | serenity-3a4351b2b5e30bdffe9e34e143fd15af67cec68f.zip |
PixelPaint: Don't hit test non-visible layers
-rw-r--r-- | Applications/PixelPaint/ImageEditor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Applications/PixelPaint/ImageEditor.cpp b/Applications/PixelPaint/ImageEditor.cpp index dd58d5e382..47101746d5 100644 --- a/Applications/PixelPaint/ImageEditor.cpp +++ b/Applications/PixelPaint/ImageEditor.cpp @@ -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); for (ssize_t i = m_image->layer_count() - 1; i >= 0; --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()))) return const_cast<Layer*>(&layer); } |