diff options
author | fvogel <fvogelnew1@free.fr> | 2017-01-07 15:26:07 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2017-01-07 15:26:07 (GMT) |
commit | 5be70aeb76c7c6ba94c9288632ddf1c094108f0e (patch) | |
tree | 948b157f22cb5311dffce5a75dd4494967e003be | |
parent | 07c65ee9c99b263ed8b6aefb42c7c5f6e47a441e (diff) | |
parent | 2aa8148b1c0d4bfd43195800910c9c6eec0ec8a2 (diff) | |
download | tk-5be70aeb76c7c6ba94c9288632ddf1c094108f0e.zip tk-5be70aeb76c7c6ba94c9288632ddf1c094108f0e.tar.gz tk-5be70aeb76c7c6ba94c9288632ddf1c094108f0e.tar.bz2 |
Merge core-8-6-branch
-rw-r--r-- | generic/tkTextDisp.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXFont.c | 2 | ||||
-rw-r--r-- | tests/constraints.tcl | 4 | ||||
-rw-r--r-- | tests/text.test | 4 | ||||
-rw-r--r-- | unix/tkUnixFont.c | 5 | ||||
-rw-r--r-- | win/tkWinFont.c | 6 |
6 files changed, 17 insertions, 6 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c060687..4b7b0db 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -7819,7 +7819,7 @@ CharChunkMeasureChars( MeasureChars(tkfont, chars, charsLen, 0, bstart, 0, -1, 0, &widthUntilStart); - xDisplacement = startX - widthUntilStart - chunkPtr->x; + xDisplacement = startX - widthUntilStart - ciPtr->baseChunkPtr->x; } fit = MeasureChars(tkfont, chars, charsLen, 0, bend, diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index d3e0e41..b5ae1a3 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -870,7 +870,7 @@ TkpMeasureCharsInContext( if (index <= start && !(flags & TK_WHOLE_WORDS)) { index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth); } - cs = (index < len || (flags & TK_WHOLE_WORDS)) ? + cs = (index <= len && (flags & TK_WHOLE_WORDS)) ? whitespaceCharacterSet : lineendingCharacterSet; while (index > start && [cs characterIsMember:[string characterAtIndex:(index - 1)]]) { diff --git a/tests/constraints.tcl b/tests/constraints.tcl index e0486ff..a87499d 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -180,7 +180,11 @@ namespace import -force tk::test::* namespace import -force tcltest::testConstraint testConstraint notAqua [expr {[tk windowingsystem] ne "aqua"}] testConstraint aqua [expr {[tk windowingsystem] eq "aqua"}] +testConstraint x11 [expr {[tk windowingsystem] eq "x11"}] testConstraint nonwin [expr {[tk windowingsystem] ne "win32"}] +testConstraint aquaOrWin32 [expr { + ([tk windowingsystem] eq "win32") || [testConstraint aqua] +}] testConstraint userInteraction 0 testConstraint nonUnixUserInteraction [expr { [testConstraint userInteraction] || diff --git a/tests/text.test b/tests/text.test index 8ba177f..6812855 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3925,7 +3925,7 @@ test text-20.5 {TextFetchSelection procedure, long selections} -setup { } -result {1} -test text-21.1 {TkTextLostSelection procedure} -constraints unix -setup { +test text-21.1 {TkTextLostSelection procedure} -constraints {x11} -setup { text .t .t insert 1.0 "Line 1" entry .t.e @@ -3940,7 +3940,7 @@ test text-21.1 {TkTextLostSelection procedure} -constraints unix -setup { } -cleanup { destroy .t .t2 } -result {} -test text-21.2 {TkTextLostSelection procedure} -constraints win -setup { +test text-21.2 {TkTextLostSelection procedure} -constraints aquaOrWin32 -setup { text .t .t insert 1.0 "Line 1" entry .t.e diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 4a466f1..0c663a3 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -1414,10 +1414,13 @@ TkpDrawCharsInContext( * whole (not just the range) string when * drawing. */ { + int widthUntilStart; + (void) numBytes; /*unused*/ + Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart); Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart, - rangeLength, x, y); + rangeLength, x+widthUntilStart, y); } /* diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 47c4c3c..860451b 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -1407,9 +1407,13 @@ TkpDrawCharsInContext( * whole (not just the range) string when * drawing. */ { + int widthUntilStart; + (void) numBytes; /*unused*/ + + Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart); Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart, - rangeLength, x, y); + rangeLength, x+widthUntilStart, y); } /* |