diff options
-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-- | tests/text.test | 4 | ||||
-rw-r--r-- | unix/tkUnixFont.c | 5 | ||||
-rw-r--r-- | win/tkWinFont.c | 6 |
6 files changed, 21 insertions, 7 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/tests/text.test b/tests/text.test index 3e5b4b6..8ba177f 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 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); } /* |