summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-10-07 19:06:56 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-10-07 19:06:56 (GMT)
commit564afe59062291dd74b51d063275dbe77bf5fb39 (patch)
treee632f0e6f41b89189ebb35a17f01c8964f613ff3
parentd931918ebcaa7835e5f6f1ef35eb80da0b9745cf (diff)
downloadtk-564afe59062291dd74b51d063275dbe77bf5fb39.zip
tk-564afe59062291dd74b51d063275dbe77bf5fb39.tar.gz
tk-564afe59062291dd74b51d063275dbe77bf5fb39.tar.bz2
Revert [e0f026c8] as a fix for [6437e8d00d] (font-24.5 test fails on macOS and Linux). This commit indeed fixed font-24.5 but it makes canvText-17.1 and canvText-19.1 newly fail.
-rw-r--r--macosx/tkMacOSXFont.c4
-rw-r--r--unix/tkUnixRFont.c16
2 files changed, 3 insertions, 17 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index 301659e..d92e6b4 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -863,10 +863,6 @@ TkpMeasureCharsInContext(
}
cs = (index <= len && (flags & TK_WHOLE_WORDS)) ?
whitespaceCharacterSet : lineendingCharacterSet;
- while ((index > start) && (index < len) && (flags & TK_WHOLE_WORDS)
- && ![cs characterIsMember:[string characterAtIndex:index]]) {
- index--;
- }
while (index > start &&
[cs characterIsMember:[string characterAtIndex:(index - 1)]]) {
index--;
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 70aebfa..8e0ce55 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -711,19 +711,9 @@ Tk_MeasureChars(
(flags & TK_AT_LEAST_ONE && curByte == 0)) {
curX = newX;
curByte = newByte;
- } 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;
- }
+ } else if (flags & TK_WHOLE_WORDS && termX != 0) {
+ curX = termX;
+ curByte = termByte;
}
break;
}