Lagrange [work/v1.11]

Widget: Prevent overflow scrolling if not tall

=> 6390717f3c84c1a17c9f618b5d7244d3d9d10e6c

diff --git a/src/ui/widget.c b/src/ui/widget.c
index 07e8e753..3e46a478 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -922,9 +922,12 @@ iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) {
 static iBool scrollOverflow_Widget_(iWidget *d, int delta) {
     iRect bounds = bounds_Widget(d);
     const iInt2 rootSize = size_Root(d->root);
-    const iRect winRect = safeRect_Root(d->root);
-    const int yTop = top_Rect(winRect);
-    const int yBottom = bottom_Rect(winRect);
+    const iRect winRect  = safeRect_Root(d->root);
+    const int   yTop     = top_Rect(winRect);
+    const int   yBottom  = bottom_Rect(winRect);
+    if (top_Rect(bounds) >= yTop && bottom_Rect(bounds) < yBottom) {
+        return iFalse; /* fits inside just fine */
+    }
     //const int safeBottom = rootSize.y - yBottom;
     bounds.pos.y += delta;
     const iRangei range = { bottom_Rect(winRect) - height_Rect(bounds), yTop };
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.11/cdiff/6390717f3c84c1a17c9f618b5d7244d3d9d10e6c
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
63.271675 milliseconds
Gemini-to-HTML Time
0.20835 milliseconds

This content has been proxied by September (ba2dc).