summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXFont.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-09-15 13:34:07 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-09-15 13:34:07 (GMT)
commitb41e7be57014d7d8f36d1f7acd6ad7a125320463 (patch)
treecf085a77e82af41e8df7c230ad74c13dd843344a /macosx/tkMacOSXFont.c
parent9e569eae6b6493fcb7c4481dd266f21bd350e8ef (diff)
downloadtk-b41e7be57014d7d8f36d1f7acd6ad7a125320463.zip
tk-b41e7be57014d7d8f36d1f7acd6ad7a125320463.tar.gz
tk-b41e7be57014d7d8f36d1f7acd6ad7a125320463.tar.bz2
3567778 Make Tk_MeasureChars() honor the TK_AT_LEAST_ONE flag properly.
Diffstat (limited to 'macosx/tkMacOSXFont.c')
-rw-r--r--macosx/tkMacOSXFont.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index e4e4e03..d800ae5 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -883,7 +883,8 @@ TkpMeasureCharsInContext(
/* The call to CTTypesetterSuggestClusterBreak above will always
return at least one character regardless of whether it exceeded
it or not. Clean that up now. */
- while (width > maxWidth && !(flags & TK_PARTIAL_OK) && index > start) {
+ while (width > maxWidth && !(flags & TK_PARTIAL_OK)
+ && index > start+(flags & TK_AT_LEAST_ONE)) {
range.length = --index;
line = CTTypesetterCreateLine(typesetter, range);
width = CTLineGetTypographicBounds(line, NULL, NULL, NULL);