Tk Source Code

Artifact [eb890293]
Login

Artifact eb8902939cf9ac223deaaa12fd8fa94a79adbd7b:

Attachment "text-see.patch" to ticket [1739605f] added by danckaert 2015-12-02 15:50:53. (unpublished)
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 93fa670..47700b3 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -5240,6 +5240,15 @@ TkTextSetYView(
     }
 
     /*
+     * If the window height is smaller than the line height, prefer to make
+     * the top of the line visible.
+     */
+
+    if (dInfoPtr->maxY - dInfoPtr->y < lineHeight) {
+        bottomY = lineHeight;
+    }
+
+    /*
      * Our job now is to arrange the display so that indexPtr appears as low
      * on the screen as possible but with its bottom no lower than bottomY.
      * BottomY is the bottom of the window if the desired line is just below