diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2021-12-14 08:24:30 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2021-12-14 08:24:30 -0400 |
commit | 691dee525adec2bbdb0bb247b6561bc2b5b23bf2 (patch) | |
tree | c574b0a330fa2c6de077b8e246a990a56191e57b /ui | |
parent | 085bab481b1ee8470f04cb6541ee01981e19f2c6 (diff) |
allow matching children of clickThrough: false els
This caused clicks not to match the context menu in mtui, where the container layer (a full-screen element) is marked clickThrough: false (but the menu and its elements are not). Basically this meant clicking menus has been broken for however long this code has been here.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/DisplayElement.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/DisplayElement.js b/ui/DisplayElement.js index a7a371a..32a62b8 100644 --- a/ui/DisplayElement.js +++ b/ui/DisplayElement.js @@ -233,7 +233,7 @@ module.exports = class DisplayElement extends Element { children.reverse() for (const el of children) { - if (!el.visible || el.clickThrough) { + if (!el.visible) { continue } @@ -242,6 +242,10 @@ module.exports = class DisplayElement extends Element { return el2 } + if (el.clickThrough) { + continue + } + const { absX, absY, w, h } = el if (absX <= x && absX + w > x) { if (absY <= y && absY + h > y) { |