This is with Tcl/Tk-8.6.12+dfsg-1 (as packaged in Debian/sid).
I'm trying to position some element on a Tcl/Tk canvas.
Traditionally, there was the canvas move command, which would move tagged items relative to their current position.
As of Tcl/Tk-8.6, there's also a canvas moveto command, which should move tagged items to an absolute position.
However, for whatever reasons the two do not behave the same.
Consider the following minimal script (where I've put the output of puts in comments):
#!/usr/bin/env wish
canvas .c -width 100 -height 100 -background white
pack .c
.c create line 0 0 0 0 -tags tag
puts [.c coord tag]
# 0.0 0.0 0.0 0.0
.c move tag 100 100
puts [.c coord tag]
# 100.0 100.0 100.0 100.0
.c move tag -100 -100
puts [.c coord tag]
# 0.0 0.0 0.0 0.0
.c moveto tag 100 100
puts [.c coord tag]
# 102.0 102.0 102.0 102.0
As you can see, if I position an item at +0+0, its bounding box will be where i expect it.
If I then do a relative move to a new position, e.g. +100+100, the item is there as it should be.
I can also do a relative move back, and the item appears at the origin.
However, if I do an absolute move to the position +100+100, the item will really show up at +102+102.
For my use-case this offset by 2 pixels in each dimension is not tolerable (as items are going to be positioned pixel-accurately)
What's going on here?
What's the use-case of moveto if it doesn't actually move the item to the requested position?
(sidenote: what is the correct tag for Tcl/Tk questions? why is tk an alias for tkinter, and tcltk for questions about an R-module?)
EDIT: i only observe this behaviour with a line item. If i instead use .c create rectangle 0 0 0 0 -tags tag the corrdinates are correct...