summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-10-06 09:45:03 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-10-06 09:45:03 (GMT)
commit07cf1af1cb979fffa3c677f3876359609ca6a3dd (patch)
tree3ed4ce6227e9552bf9f23929a2a70da4bd05bded /unix
parenta094442dfa3dd1a99d05170f59eda6720c7753bb (diff)
parent075e60b53e49033f2d3caac1d5a78cde953bc200 (diff)
downloadtk-07cf1af1cb979fffa3c677f3876359609ca6a3dd.zip
tk-07cf1af1cb979fffa3c677f3876359609ca6a3dd.tar.gz
tk-07cf1af1cb979fffa3c677f3876359609ca6a3dd.tar.bz2
Fix [6437e8d00d]: font-24.5 test fails on macOS and Linux.
Diffstat (limited to 'unix')
-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;
}