mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
PixelPaint: Don't hit test non-visible layers
This commit is contained in:
parent
b560445c84
commit
3a4351b2b5
Notes:
sideshowbarker
2024-07-19 04:39:14 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3a4351b2b5e
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);
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue