summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/widget.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 4749de23..1a0b2ce7 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -928,9 +928,12 @@ iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) {
928iBool scrollOverflow_Widget(iWidget *d, int delta) { 928iBool scrollOverflow_Widget(iWidget *d, int delta) {
929 iRect bounds = bounds_Widget(d); 929 iRect bounds = bounds_Widget(d);
930 const iInt2 rootSize = size_Root(d->root); 930 const iInt2 rootSize = size_Root(d->root);
931 const iRect winRect = safeRect_Root(d->root); 931 const iRect winRect = safeRect_Root(d->root);
932 const int yTop = top_Rect(winRect); 932 const int yTop = top_Rect(winRect);
933 const int yBottom = bottom_Rect(winRect); 933 const int yBottom = bottom_Rect(winRect);
934 if (top_Rect(bounds) >= yTop && bottom_Rect(bounds) < yBottom) {
935 return iFalse; /* fits inside just fine */
936 }
934 //const int safeBottom = rootSize.y - yBottom; 937 //const int safeBottom = rootSize.y - yBottom;
935 bounds.pos.y += delta; 938 bounds.pos.y += delta;
936 const iRangei range = { bottom_Rect(winRect) - height_Rect(bounds), yTop }; 939 const iRangei range = { bottom_Rect(winRect) - height_Rect(bounds), yTop };