GUI: Account for the scroll bar size in ScrollContainerWidget objects

This commit is contained in:
Cameron Cawley 2022-12-26 00:01:10 +00:00 committed by Eugene Sandulenko
parent 30bdbb6f76
commit 7ef8da53d7
9 changed files with 148 additions and 38 deletions

View file

@ -166,7 +166,7 @@ void Widget::draw() {
Widget *Widget::findWidgetInChain(Widget *w, int x, int y) {
while (w) {
// Stop as soon as we find a widget that contains the point (x,y)
if (x >= w->_x && x < w->_x + w->_w && y >= w->_y && y < w->_y + w->getHeight())
if (x >= w->_x && x < w->_x + w->getWidth() && y >= w->_y && y < w->_y + w->getHeight())
break;
w = w->_next;
}