From 691dee525adec2bbdb0bb247b6561bc2b5b23bf2 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 14 Dec 2021 08:24:30 -0400 Subject: 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. --- ui/DisplayElement.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- cgit 1.3.0-6-gf8a5