summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-09-24 15:00:07 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-09-24 15:00:07 (GMT)
commitdf3a9de021b466acd24e2d10e0223a6786b51fe6 (patch)
tree09498538ffb65f54733979b02223bb7b2c3293e5
parent77ed324954725331597e86d2f066e38f08b9093c (diff)
parent6bd394b3fb73b144c83e6253afc5e6993c8e64ae (diff)
downloadtk-df3a9de021b466acd24e2d10e0223a6786b51fe6.zip
tk-df3a9de021b466acd24e2d10e0223a6786b51fe6.tar.gz
tk-df3a9de021b466acd24e2d10e0223a6786b51fe6.tar.bz2
Fix [1e0db2400c]: canvas rchars leaves artifacts when line bounding box gets smaller.
-rw-r--r--generic/tkCanvas.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 9c4d60a..ecabe22 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -1186,8 +1186,8 @@ CanvasWidgetCmd(
FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto doneImove) {
int index;
- int x1,x2,y1,y2;
- int dontRedraw1,dontRedraw2;
+ int x1, x2, y1, y2;
+ int dontRedraw1, dontRedraw2;
/*
* The TK_MOVABLE_POINTS flag should only be set for types that
@@ -1217,11 +1217,11 @@ CanvasWidgetCmd(
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
ItemDelChars(canvasPtr, itemPtr, index, index);
- dontRedraw1=itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
+ dontRedraw1 = itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
ItemInsert(canvasPtr, itemPtr, index, tmpObj);
- dontRedraw2=itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
+ dontRedraw2 = itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
if (!(dontRedraw1 && dontRedraw2)) {
Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
@@ -1334,7 +1334,7 @@ CanvasWidgetCmd(
}
case CANV_DCHARS: {
int first, last;
- int x1,x2,y1,y2;
+ int x1, x2, y1, y2;
if ((objc != 4) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId first ?last?");
@@ -1362,7 +1362,7 @@ CanvasWidgetCmd(
/*
* Redraw both item's old and new areas: it's possible that a
* delete could result in a new area larger than the old area.
- * Except if the insertProc sets the TK_ITEM_DONT_REDRAW flag,
+ * Except if the dCharsProc sets the TK_ITEM_DONT_REDRAW flag,
* nothing more needs to be done.
*/
@@ -1572,7 +1572,7 @@ CanvasWidgetCmd(
}
case CANV_INSERT: {
int beforeThis;
- int x1,x2,y1,y2;
+ int x1, x2, y1, y2;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId beforeThis string");
@@ -1800,7 +1800,8 @@ CanvasWidgetCmd(
}
case CANV_RCHARS: {
int first, last;
- int x1,x2,y1,y2;
+ int x1, x2, y1, y2;
+ int dontRedraw1, dontRedraw2;
if (objc != 6) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId first last string");
@@ -1831,12 +1832,16 @@ CanvasWidgetCmd(
x1 = itemPtr->x1; y1 = itemPtr->y1;
x2 = itemPtr->x2; y2 = itemPtr->y2;
- itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
ItemDelChars(canvasPtr, itemPtr, first, last);
+ dontRedraw1 = itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
+
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
ItemInsert(canvasPtr, itemPtr, first, objv[5]);
+ dontRedraw2 = itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
- if (!(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW)) {
+ if (!(dontRedraw1 && dontRedraw2)) {
Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
x1, y1, x2, y2);
EventuallyRedrawItem(canvasPtr, itemPtr);