summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixRFont.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-10-07 19:40:03 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-10-07 19:40:03 (GMT)
commite112662cca542c5a8dd957d115d465451a20ca79 (patch)
tree01e933886347e5b4f941e424203f7985ad48928a /unix/tkUnixRFont.c
parent26ad66bc80be1bb50bed405300578c388fbd2c23 (diff)
downloadtk-e112662cca542c5a8dd957d115d465451a20ca79.zip
tk-e112662cca542c5a8dd957d115d465451a20ca79.tar.gz
tk-e112662cca542c5a8dd957d115d465451a20ca79.tar.bz2
Re-integrate the tentative fixes for font-24.5 ([94cfd2f6] for macOS and [1235434d] for Linux) in the present bugfix branch.
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r--unix/tkUnixRFont.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 8e0ce55..70aebfa 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -711,9 +711,19 @@ Tk_MeasureChars(
(flags & TK_AT_LEAST_ONE && curByte == 0)) {
curX = newX;
curByte = newByte;
- } else if (flags & TK_WHOLE_WORDS && termX != 0) {
- curX = termX;
- curByte = termByte;
+ } else if (flags & TK_WHOLE_WORDS) {
+ if ((flags & TK_AT_LEAST_ONE) && (termX == 0)) {
+ /*
+ * No space was seen before reaching the right
+ * of the allotted maxLength space, i.e. no word
+ * boundary. Return the string that fills the
+ * allotted space, without overfill.
+ * curX and curByte are already the right ones:
+ */
+ } else {
+ curX = termX;
+ curByte = termByte;
+ }
}
break;
}