From 754470dcfaf723e65e1f0956dee928c6c586e16e Mon Sep 17 00:00:00 2001 From: Miklos Marton Date: Fri, 8 Nov 2024 15:57:00 +0100 Subject: [PATCH] Fix hardcoded 60 px button height in the SoftKeyMaskRenderAreaComponent::getClickedChildRecursive --- src/SoftkeyMaskRenderArea.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SoftkeyMaskRenderArea.cpp b/src/SoftkeyMaskRenderArea.cpp index 4d16b45..de3b7de 100644 --- a/src/SoftkeyMaskRenderArea.cpp +++ b/src/SoftkeyMaskRenderArea.cpp @@ -228,14 +228,16 @@ std::shared_ptr SoftKeyMaskRenderAreaComponent::getClickedChil // Knowing the location requires some knowledge of how the mask is displaying each key... if ((nullptr != child) && - (objectCanBeClicked(child)) && - (isClickWithinBounds(x, y, 10, 10 + (60 * i) + (10 * i), ownerServer.get_soft_key_descriptor_x_pixel_width(), ownerServer.get_soft_key_descriptor_y_pixel_width()))) + (objectCanBeClicked(child)) && + (isClickWithinBounds(x, y, + 10, 10 + (ownerServer.get_soft_key_descriptor_x_pixel_width() * i) + (10 * i), + ownerServer.get_soft_key_descriptor_x_pixel_width(), ownerServer.get_soft_key_descriptor_y_pixel_width()))) { return child; } else if (!objectCanBeClicked(child)) { - retVal = getClickedChildRecursive(child, x - 10, y - (10 + (60 * i) + (10 * i))); + retVal = getClickedChildRecursive(child, x - 10, y - (10 + (ownerServer.get_soft_key_descriptor_y_pixel_width() * i) + (10 * i))); if (nullptr != retVal) {