Tk Source Code

View Ticket
Login
Ticket UUID: 2899685
Title: Artefact line segments with canvas imove
Type: Bug Version: obsolete: 8.6b1
Submitter: yschekin Created on: 2009-11-18 10:04:50
Subsystem: 04. Canvas Basics Assigned To: hobbs
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2009-11-20 05:29:16
Resolution: Fixed Closed By: ferrieux
    Closed on: 2009-11-19 22:29:16
Description:
Tested on WinXP SP 2 only now.

The script:
---
canvas .c
button .b -command {doit} -text "Bug"
grid .c
grid .b

set id [.c create line 10 10 40 10 100 100]

proc doit {} {
global id
.c imove $id 1 200 200
.c imove $id 1 30 20
}
---

Launch it. Press "bug" button. I see horizontal line fragment from top left corner.
Now resize window. The fragment disappears.
User Comments: ferrieux added on 2009-11-20 05:29:15:
Thanks. Committed.

hobbs added on 2009-11-20 05:14:26:
Did a repro, ferrieux appears to have the correct analysis.

ferrieux added on 2009-11-19 05:26:32:
And by the way, the reason dChars didn't set the "don't redraw" flag is a separate bug, 2900121. Fortunate in some sense.

ferrieux added on 2009-11-19 00:49:15:

File Added - 351496: imove.patch

ferrieux added on 2009-11-19 00:48:33:
OK got it. Attached patch fixes the issue.
The problem is that imove does a "dChars" and an "insert" with an implicit OR on the "don't redraw" directives from both functions, while it should be an AND.

ferrieux added on 2009-11-18 21:13:32:
Yes, it is a wrong computation of the refresh region.
If you replace the [imove] par the equivalent [coords], the problem disappears. This is due to [coords] being brute-force and scheduling a refresh of the whole item, while [imove] tries to be smarter by computing the bounding box of only the delta:

 .c coords $id 30 20 40 10 100 100 => EventuallyRedrawItem: 8 8 102 102

 .c imove $id 1 30 20 => Tk_CanvasEventuallyRedraw: 29 9 41 21

It is at least reminiscent of the more obscure 2825888 (which was about overlap computation).
If it turns out so, I'll owe you an extra Thank You for producing a much more visible symptom :)

yschekin added on 2009-11-18 17:15:08:
After filing this bug report about imove, I've noticed that it's similar to 2816150.
Artifacts go away if I just minimize/maximize window, or
just send it to back, then to front. So it may be connected to canvas
refresh.

Attachments: