summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvas.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-09-17 19:56:15 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-09-17 19:56:15 (GMT)
commit591497fd4e6c70e2175362820a84e3b380eec83a (patch)
treef0c391029baf04bba8aae9952e0373fdba23169c /generic/tkCanvas.c
parent802bcc1bb7fbaf4ba91d5b820b90a67ebcc766b9 (diff)
downloadtk-591497fd4e6c70e2175362820a84e3b380eec83a.zip
tk-591497fd4e6c70e2175362820a84e3b380eec83a.tar.gz
tk-591497fd4e6c70e2175362820a84e3b380eec83a.tar.bz2
Fix [1e0db2400c]: canvas rchars leaves artifacts when line bounding box gets smaller
Diffstat (limited to 'generic/tkCanvas.c')
-rw-r--r--generic/tkCanvas.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 9c4d60a..be19f5f 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -1801,6 +1801,7 @@ CanvasWidgetCmd(
case CANV_RCHARS: {
int first, last;
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);