summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2015-12-12 17:44:50 (GMT)
committerfvogel <fvogel@noemail.net>2015-12-12 17:44:50 (GMT)
commit7fcb6ada52c82850516c6ea4939cee774d0e4706 (patch)
treef1e1a4b536a4fa225d18dfe708718cb67764c192 /generic/tkTextDisp.c
parent0b9dce49bac900e7a5137784174f8ca2e1b8b80a (diff)
parentfe63509cfd2ae7765d6160994ccded650a513734 (diff)
downloadtk-7fcb6ada52c82850516c6ea4939cee774d0e4706.zip
tk-7fcb6ada52c82850516c6ea4939cee774d0e4706.tar.gz
tk-7fcb6ada52c82850516c6ea4939cee774d0e4706.tar.bz2
Fix for bug [1739605] - [text see] misbehaves following widget create/populate - Patch from Koen Danckaert
FossilOrigin-Name: cc3b73908117292142f4583c019b503ea89937d3
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 74620fc..86a81c0 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -5239,6 +5239,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