From 4122c77d4999c3ead1140dd12f7c2b8d8ebca150 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 11 Aug 2010 09:39:08 +0000 Subject: * generic/tkCanvLine.c (LineDeleteCoords): [Bug 2900121]: Backport of fix to sense of test. --- ChangeLog | 26 +++++++++++++++--------- generic/tkCanvLine.c | 57 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 386c318..8ebaff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-11 Donal K. Fellows + + * generic/tkCanvLine.c (LineDeleteCoords): [Bug 2900121]: Backport of + fix to sense of test. + 2010-08-10 Don Porter * library/msgs/pl.msg: Backport updates to pl.msg from HEAD @@ -6,7 +11,7 @@ *** 8.5.9 TAGGED FOR RELEASE *** - * license.terms: fix DFARs note for number-adjusted rights clause + * license.terms: Fix DFARs note for number-adjusted rights clause 2010-08-04 Don Porter @@ -24,8 +29,8 @@ 2010-08-03 Jeff Hobbs - * library/button.tcl (::tk::CheckEnter): use uplevel set instead - of set :: to work with other var resolvers (itcl). [AS Bug#87409] + * library/button.tcl (::tk::CheckEnter): [AS Bug#87409]: Use uplevel + set instead of set :: to work with other var resolvers (itcl). 2010-08-03 Don Porter @@ -33,20 +38,21 @@ 2010-07-06 Andreas Kupries - * doc/text.n: Fixed minor typo in the description of 'text - delete', as reported by on the chat. + * doc/text.n: Fixed minor typo in the description of 'text delete', as + reported by on the chat. 2010-05-31 Joe English - * generic/tkBind.c(Tk_CreateBinding): Silently ignore empty - binding scripts (Fixes [Bug 3006842]). - * generic/ttk/ttkTreeview.c: [$tv tag bind $tag <...> {}] - now removes binding. + * generic/tkBind.c (Tk_CreateBinding): [Bug 3006842]: Silently ignore + empty binding scripts. + * generic/ttk/ttkTreeview.c: [$tv tag bind $tag <...> {}] now removes + binding. 2010-05-31 Jan Nijtmans * generic/tkMain.c: Fix CYGWIN warning: "fd_set and assiciated.macros - have been defined in sys/types. This may cause runtime problems with W32" + have been defined in sys/types. This may cause runtime problems with + W32" * win/winMain.c: Add command line processing for CYGWIN, backported from trunk. diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index b0e122c..d2954f2 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvLine.c,v 1.22 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvLine.c,v 1.22.2.1 2010/08/11 09:39:08 dkf Exp $ */ #include @@ -1151,7 +1151,7 @@ LineDeleteCoords( double *coordPtr; Tk_State state = itemPtr->state; - if(state == TK_STATE_NULL) { + if (state == TK_STATE_NULL) { state = ((TkCanvas *)canvas)->canvas_state; } @@ -1175,15 +1175,24 @@ LineDeleteCoords( linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0]; linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1]; } - first1 = first; last1 = last; - if(first1>0) first1 -= 2; - if(last1 0) { + first1 -= 2; + } + if (last1 < length-2) { + last1 += 2; + } if (linePtr->smooth) { - if(first1>0) first1 -= 2; - if(last1 0) { + first1 -= 2; + } + if (last1 < length-2) { + last1 += 2; + } } - if((first1<2) && (last1 >= length-2)) { + if (!(first1 < 2) && (last1 >= length-2)) { /* * This is some optimizing code that will result that only the part of * the line that changed (and the objects that are overlapping with @@ -1196,7 +1205,7 @@ LineDeleteCoords( itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW; itemPtr->x1 = itemPtr->x2 = (int) linePtr->coordPtr[first1]; itemPtr->y1 = itemPtr->y2 = (int) linePtr->coordPtr[first1+1]; - if ((linePtr->firstArrowPtr != NULL) && (first1<2)) { + if ((linePtr->firstArrowPtr != NULL) && (first1 < 2)) { /* * Include old first arrow. */ @@ -1206,7 +1215,7 @@ LineDeleteCoords( TkIncludePoint(itemPtr, coordPtr); } } - if ((linePtr->lastArrowPtr != NULL) && (last1>=length-2)) { + if ((linePtr->lastArrowPtr != NULL) && (last1 >= length-2)) { /* * Include old last arrow. */ @@ -1219,7 +1228,7 @@ LineDeleteCoords( coordPtr = linePtr->coordPtr+first1+2; for (i=first1+2; i<=last1; i+=2) { TkIncludePoint(itemPtr, coordPtr); - coordPtr+=2; + coordPtr += 2; } } @@ -1237,13 +1246,13 @@ LineDeleteCoords( linePtr->lastArrowPtr = NULL; } if (linePtr->arrow != ARROWS_NONE) { - ConfigureArrows(canvas, linePtr); + ConfigureArrows(canvas, linePtr); } - if(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW) { + if (itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW) { double width; int intWidth; - if ((linePtr->firstArrowPtr != NULL) && (first1<4)) { + if ((linePtr->firstArrowPtr != NULL) && (first1 < 4)) { /* * Include new first arrow. */ @@ -1253,7 +1262,7 @@ LineDeleteCoords( TkIncludePoint(itemPtr, coordPtr); } } - if ((linePtr->lastArrowPtr != NULL) && (last1>(length-4))) { + if ((linePtr->lastArrowPtr != NULL) && (last1 > length-4)) { /* * Include new right arrow. */ @@ -1265,20 +1274,22 @@ LineDeleteCoords( } width = linePtr->outline.width; if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { - if (linePtr->outline.activeWidth>width) { - width = linePtr->outline.activeWidth; - } + if (linePtr->outline.activeWidth > width) { + width = linePtr->outline.activeWidth; + } } else if (state==TK_STATE_DISABLED) { - if (linePtr->outline.disabledWidth>0) { - width = linePtr->outline.disabledWidth; - } + if (linePtr->outline.disabledWidth > 0) { + width = linePtr->outline.disabledWidth; + } } intWidth = (int) (width + 0.5); if (intWidth < 1) { intWidth = 1; } - itemPtr->x1 -= intWidth; itemPtr->y1 -= intWidth; - itemPtr->x2 += intWidth; itemPtr->y2 += intWidth; + itemPtr->x1 -= intWidth; + itemPtr->y1 -= intWidth; + itemPtr->x2 += intWidth; + itemPtr->y2 += intWidth; Tk_CanvasEventuallyRedraw(canvas, itemPtr->x1, itemPtr->y1, itemPtr->x2, itemPtr->y2); } -- cgit v0.12