[Scummvm-git-logs] scummvm master -> c390af49eaeab5fadd8f5668ad84b49cd43054a7
criezy
noreply at scummvm.org
Thu Apr 23 22:06:20 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
c390af49ea GUI: Fix clicking on indirect children of a ScrollContainerWidget
Commit: c390af49eaeab5fadd8f5668ad84b49cd43054a7
https://github.com/scummvm/scummvm/commit/c390af49eaeab5fadd8f5668ad84b49cd43054a7
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2026-04-23T23:00:33+01:00
Commit Message:
GUI: Fix clicking on indirect children of a ScrollContainerWidget
This fixes a regression introduced in 441f97f4e4 (Implement drag to
scroll in ScrollContainer). The computation of the X and Y location
in the child when forwarding mouse down and up events assumed that
that child was a direct child of the ScrollContainerWidget (i.e.
that the child getRelX() and getRelY() are the position relative
to the ScrollContainerWidget). That caused incorrect x and y for
children of children.
One place where this could be seen are the custom game options
(Game tab of the Game Options dialog).
This commit fixes the issue by computing the relative position
of the child to the ScrollContainerWidget from their respective
absolute location).
Changed paths:
gui/widgets/scrollcontainer.cpp
diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp
index 0ac21c93241..4bf2b30f3e0 100644
--- a/gui/widgets/scrollcontainer.cpp
+++ b/gui/widgets/scrollcontainer.cpp
@@ -65,8 +65,8 @@ void ScrollContainerWidget::handleMouseDown(int x, int y, int button, int clickC
_fluidScroller->stopAnimation();
Widget *child = _childUnderMouse;
if (child) {
- int childX = (x + _scrolledX) - child->getRelX();
- int childY = (y + _scrolledY) - child->getRelY();
+ int childX = (x + _scrolledX) - (child->getAbsX() - getAbsX());
+ int childY = (y + _scrolledY) - (child->getAbsY() - getAbsY());
child->handleMouseDown(childX, childY, button, clickCount);
}
}
@@ -120,8 +120,8 @@ void ScrollContainerWidget::handleMouseUp(int x, int y, int button, int clickCou
_childUnderMouse = nullptr;
if (!isDragging && child) {
- int childX = (x + _scrolledX) - child->getRelX();
- int childY = (y + _scrolledY) - child->getRelY();
+ int childX = (x + _scrolledX) - (child->getAbsX() - getAbsX());
+ int childY = (y + _scrolledY) - (child->getAbsY() - getAbsY());
child->handleMouseUp(childX, childY, button, clickCount);
}
}
More information about the Scummvm-git-logs
mailing list