From 8d97f6db09f68ff3114e19f879e118fc3f7ed3f2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 17 Sep 2017 19:56:15 +0000 Subject: Fix [1e0db2400c]: canvas rchars leaves artifacts when line bounding box gets smaller --- generic/tkCanvas.c | 9 +++++++-- 1 file 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); -- cgit v0.12