diff options
author | fvogel <fvogelnew1@free.fr> | 2017-01-07 15:34:15 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2017-01-07 15:34:15 (GMT) |
commit | 85410be606630673a7e3dd0f085a52a448992b61 (patch) | |
tree | b1ed439cac824091930f3a9b28409bce74ae5f3c | |
parent | 9b3fe0c672d42ca2758d5eddc0514738d5ec6f90 (diff) | |
parent | 2aa8148b1c0d4bfd43195800910c9c6eec0ec8a2 (diff) | |
download | tk-85410be606630673a7e3dd0f085a52a448992b61.zip tk-85410be606630673a7e3dd0f085a52a448992b61.tar.gz tk-85410be606630673a7e3dd0f085a52a448992b61.tar.bz2 |
Merge core-8-6-branch
-rw-r--r-- | .fossil-settings/ignore-glob | 3 | ||||
-rw-r--r-- | generic/tkCanvUtil.c | 8 | ||||
-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 | 8 | ||||
-rw-r--r-- | unix/tkUnixFont.c | 5 | ||||
-rw-r--r-- | win/tkWinFont.c | 6 |
8 files changed, 28 insertions, 10 deletions
diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index e404f52..e8f5bbb 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -6,6 +6,7 @@ *.lib *.o *.obj +*.pdb *.res *.sl *.so @@ -18,4 +19,6 @@ */tktest* */versions.vc doc/man.macros +win/Debug_VC* +win/Release_VC* unix/tk.pc diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index cbbc2b4..09ce98c 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -1136,7 +1136,9 @@ Tk_ConfigOutlineGC( if (mask && (dash->number != 0)) { gcValues->line_style = LineOnOffDash; gcValues->dash_offset = outline->offset; - if (dash->number > 0) { + if ((unsigned int)ABS(dash->number) > sizeof(char *)) { + gcValues->dashes = dash->pattern.pt[0]; + } else if (dash->number != 0) { gcValues->dashes = dash->pattern.array[0]; } else { gcValues->dashes = (char) (4 * width + 0.5); @@ -1340,7 +1342,9 @@ Tk_ResetOutlineGC( if ((dash->number > 2) || (dash->number < -1) || (dash->number==2 && (dash->pattern.array[0] != dash->pattern.array[1])) || ((dash->number == -1) && (dash->pattern.array[0] != ','))) { - if (dash->number > 0) { + if ((unsigned int)ABS(dash->number) > sizeof(char *)) { + dashList = dash->pattern.pt[0]; + } else if (dash->number != 0) { dashList = dash->pattern.array[0]; } else { dashList = (char) (4 * width + 0.5); diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 2171cd0..1be26c4 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 3e5b4b6..6812855 100644 --- a/tests/text.test +++ b/tests/text.test @@ -922,9 +922,9 @@ test text-2.8 {Tk_TextCmd procedure} -constraints { .t tag cget sel -relief } -cleanup { destroy .t -} -result {solid} +} -result {flat} test text-2.9 {Tk_TextCmd procedure} -constraints { - unix + unix notAqua } -body { catch {destroy .t} text .t @@ -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); } /* |