summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkConsole.c6
-rw-r--r--generic/tkTextBTree.c2
-rw-r--r--library/console.tcl2
-rw-r--r--library/listbox.tcl2
-rw-r--r--library/text.tcl2
-rw-r--r--macosx/tkMacOSXDraw.c10
-rw-r--r--tests/corruptMangled.gifbin64 -> 64 bytes
-rw-r--r--tests/imgPhoto.test26
-rw-r--r--win/tkWinDraw.c52
9 files changed, 91 insertions, 11 deletions
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 8bfbe9b..a6a8cbf 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -318,7 +318,7 @@ Tk_InitConsoleChannels(
* Tk_CreateConsoleWindow --
*
* Initialize the console. This code actually creates a new application
- * and associated interpreter. This effectivly hides the implementation
+ * and associated interpreter. This effectively hides the implementation
* from the main application.
*
* Results:
@@ -344,9 +344,13 @@ Tk_CreateConsoleWindow(
/* Init an interp with Tcl and Tk */
Tcl_Interp *consoleInterp = Tcl_CreateInterp();
if (Tcl_Init(consoleInterp) != TCL_OK) {
+ Tcl_Obj *result_obj = Tcl_GetObjResult(consoleInterp);
+ Tcl_SetObjResult(interp, result_obj);
goto error;
}
if (Tk_Init(consoleInterp) != TCL_OK) {
+ Tcl_Obj *result_obj = Tcl_GetObjResult(consoleInterp);
+ Tcl_SetObjResult(interp, result_obj);
goto error;
}
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index c20c546..81e31dc 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -799,6 +799,7 @@ RemovePixelClient(
nodePtr->numPixels[treePtr->pixelReferences-1];
}
if (treePtr->pixelReferences == 1) {
+ ckfree(nodePtr->numPixels);
nodePtr->numPixels = NULL;
} else {
nodePtr->numPixels = ckrealloc(nodePtr->numPixels,
@@ -1439,6 +1440,7 @@ TkBTreeDeleteIndexRange(
prevNodePtr->nextPtr = curNodePtr->nextPtr;
}
parentPtr->numChildren--;
+ DeleteSummaries(curNodePtr->summaryPtr);
ckfree(curNodePtr->numPixels);
ckfree(curNodePtr);
curNodePtr = parentPtr;
diff --git a/library/console.tcl b/library/console.tcl
index ba68ccc..355a43b 100644
--- a/library/console.tcl
+++ b/library/console.tcl
@@ -286,6 +286,7 @@ proc ::tk::ConsoleHistory {cmd} {
}
.console delete promptEnd end
.console insert promptEnd $cmd {input stdin}
+ .console see end
}
next {
incr HistNum
@@ -302,6 +303,7 @@ proc ::tk::ConsoleHistory {cmd} {
}
.console delete promptEnd end
.console insert promptEnd $cmd {input stdin}
+ .console see end
}
reset {
set HistNum 1
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 17c03c0..1b35b3d 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -206,7 +206,7 @@ if {"x11" eq [tk windowingsystem]} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
- # http://www.inria.fr/koala/colas/mouse-wheel-scroll/
+ # http://linuxreviews.org/howtos/xfree/mouse/
bind Listbox <4> {
if {!$tk_strictMotif} {
%W yview scroll -5 units
diff --git a/library/text.tcl b/library/text.tcl
index 2bf1b2b..9eb6e31 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -463,7 +463,7 @@ if {"x11" eq [tk windowingsystem]} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
- # http://www.inria.fr/koala/colas/mouse-wheel-scroll/
+ # http://linuxreviews.org/howtos/xfree/mouse/
bind Text <4> {
if {!$tk_strictMotif} {
%W yview scroll -50 pixels
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 5ca8bfe..d1e67dc 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -858,6 +858,16 @@ XDrawLines(
CGContextAddLineToPoint(dc.context, prevx, prevy);
}
}
+ /*
+ * In the case of closed polylines, the first and last points
+ * are the same. We want miter or bevel join be rendered also
+ * at this point, this needs telling CoreGraphics that the
+ * path is closed.
+ */
+ if ((points[0].x == points[npoints-1].x) &&
+ (points[0].y == points[npoints-1].y)) {
+ CGContextClosePath(dc.context);
+ }
CGContextStrokePath(dc.context);
}
TkMacOSXRestoreDrawingContext(&dc);
diff --git a/tests/corruptMangled.gif b/tests/corruptMangled.gif
index ce043f0..9c1637c 100644
--- a/tests/corruptMangled.gif
+++ b/tests/corruptMangled.gif
Binary files differ
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index 4f3611e..4bff5cc 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -1256,7 +1256,7 @@ test imgPhoto-18.1 {Reject corrupted GIF (binary string)} -constraints {
} -setup {
package require base64
set data [base64::decode {
- R0lGODlhwjMz//8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV
+ R0lGODlhAAQABP8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV
5qpraXIvM1JlNyAgOw==
}]
} -body {
@@ -1266,7 +1266,7 @@ test imgPhoto-18.1 {Reject corrupted GIF (binary string)} -constraints {
} -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp
test imgPhoto-18.2 {Reject corrupted GIF (base 64 string)} -setup {
set data {
- R0lGODlhwjMz//8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV
+ R0lGODlhAAQABP8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV
5qpraXIvM1JlNyAgOw==
}
} -body {
@@ -1310,8 +1310,12 @@ test imgPhoto-18.6 {Reject truncated GIF (file)} -setup {
catch {image delete gif1}
} -returnCodes error -result {error reading color map}
test imgPhoto-18.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints {
- base64PackageNeeded
+ base64PackageNeeded nonPortable
} -setup {
+ # About the non portability constraint of this test: see ticket [cc42cc18a5]
+ # If there is insufficient memory, the error message
+ # {not enough free memory for image buffer} should be returned.
+ # Instead, some systems (e.g. FreeBSD 11.1) terminate the test interpreter.
package require base64
set data [base64::decode {
R0lGODlhwmYz//8zM/8z/zP/MzP/////M////yH5Ciwhe
@@ -1322,7 +1326,13 @@ test imgPhoto-18.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints {
} -cleanup {
catch {image delete gif1}
} -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp
-test imgPhoto-18.8 {Reject corrupted GIF (> 4Gb) (base 64 string)} -setup {
+test imgPhoto-18.8 {Reject corrupted GIF (> 4Gb) (base 64 string)} -constraints {
+ nonPortable
+} -setup {
+ # About the non portability constraint of this test: see ticket [cc42cc18a5]
+ # If there is insufficient memory, the error message
+ # {not enough free memory for image buffer} should be returned.
+ # Instead, some systems (e.g. FreeBSD 11.1) terminate the test interpreter.
set data {
R0lGODlhwmYz//8zM/8z/zP/MzP/////M////yH5Ciwhe
LrcLTBCd6Tv2qW16tdK4jhV5qpraXIvM1JlNyAgOw==
@@ -1332,7 +1342,13 @@ test imgPhoto-18.8 {Reject corrupted GIF (> 4Gb) (base 64 string)} -setup {
} -cleanup {
catch {image delete gif1}
} -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp
-test imgPhoto-18.9 {Reject corrupted GIF (> 4Gb) (file)} -setup {
+test imgPhoto-18.9 {Reject corrupted GIF (> 4Gb) (file)} -constraints {
+ nonPortable
+} -setup {
+ # About the non portability constraint of this test: see ticket [cc42cc18a5]
+ # If there is insufficient memory, the error message
+ # {not enough free memory for image buffer} should be returned.
+ # Instead, some systems (e.g. FreeBSD 11.1) terminate the test interpreter.
set fileName [file join [file dirname [info script]] corruptMangled4G.gif]
} -body {
image create photo gif1 -file $fileName
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 1d17cc6..e13a5e5 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -741,6 +741,52 @@ XFillRectangles(
/*
*----------------------------------------------------------------------
*
+ * MakeAndStrokePath --
+ *
+ * This function draws a shape using a list of points, a stipple pattern,
+ * and the specified drawing function. It does it through creation of a
+ * so-called 'path' (see GDI documentation on MSDN).
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+MakeAndStrokePath(
+ HDC dc,
+ POINT *winPoints,
+ int npoints,
+ WinDrawFunc func) /* Name of the Windows GDI drawing function:
+ this is either Polyline or Polygon. */
+{
+ BeginPath(dc);
+ func(dc, winPoints, npoints);
+ /*
+ * In the case of closed polylines, the first and last points
+ * are the same. We want miter or bevel join be rendered also
+ * at this point, this needs telling the Windows GDI that the
+ * path is closed.
+ */
+ if (func == Polyline) {
+ if ((winPoints[0].x == winPoints[npoints-1].x) &&
+ (winPoints[0].y == winPoints[npoints-1].y)) {
+ CloseFigure(dc);
+ }
+ EndPath(dc);
+ StrokePath(dc);
+ } else {
+ EndPath(dc);
+ StrokeAndFillPath(dc);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* RenderObject --
*
* This function draws a shape using a list of points, a stipple pattern,
@@ -833,7 +879,7 @@ RenderObject(
SetPolyFillMode(dcMem, (gc->fill_rule == EvenOddRule) ? ALTERNATE
: WINDING);
oldMemBrush = SelectObject(dcMem, CreateSolidBrush(gc->foreground));
- func(dcMem, winPoints, npoints);
+ MakeAndStrokePath(dcMem, winPoints, npoints, func);
BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYFG);
/*
@@ -845,7 +891,7 @@ RenderObject(
if (gc->fill_style == FillOpaqueStippled) {
DeleteObject(SelectObject(dcMem,
CreateSolidBrush(gc->background)));
- func(dcMem, winPoints, npoints);
+ MakeAndStrokePath(dcMem, winPoints, npoints, func);
BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0,
COPYBG);
}
@@ -861,7 +907,7 @@ RenderObject(
SetPolyFillMode(dc, (gc->fill_rule == EvenOddRule) ? ALTERNATE
: WINDING);
- func(dc, winPoints, npoints);
+ MakeAndStrokePath(dc, winPoints, npoints, func);
SelectObject(dc, oldPen);
}
DeleteObject(SelectObject(dc, oldBrush));