Skip to content

Commit

Permalink
Fix hardcoded 60 px button height in the
Browse files Browse the repository at this point in the history
SoftKeyMaskRenderAreaComponent::getClickedChildRecursive
  • Loading branch information
martonmiklos authored and ad3154 committed Nov 9, 2024
1 parent 599791b commit 47edd65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/SoftkeyMaskRenderArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,16 @@ std::shared_ptr<isobus::VTObject> 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)
{
Expand Down

0 comments on commit 47edd65

Please sign in to comment.