summaryrefslogtreecommitdiffstats
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)
commit8d97f6db09f68ff3114e19f879e118fc3f7ed3f2 (patch)
treef0c391029baf04bba8aae9952e0373fdba23169c
parent28ecd1d8e1c3f719e76cf10280c207b62dcd3769 (diff)
downloadtk-8d97f6db09f68ff3114e19f879e118fc3f7ed3f2.zip
tk-8d97f6db09f68ff3114e19f879e118fc3f7ed3f2.tar.gz
tk-8d97f6db09f68ff3114e19f879e118fc3f7ed3f2.tar.bz2
Fix [1e0db2400c]: canvas rchars leaves artifacts when line bounding box gets smaller
-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);