[Gtk-sharp-list] Gnome.Canvas coordinate weirdness (independant of scaling it is off by 50 pixels)
Sebastian
scut@nb.in-berlin.de
Tue, 11 Nov 2003 20:30:12 +0800
--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello again,
I cannot figure out a very strange behaviour when using Gnome.Canvas. I use
mcs 0.26 (Alp's Debian packages) and a manually compiled gtk-sharp 0.12 on
Debian/sid with libgdk-pixbuf2, version 0.22.0-3.
The attached sample file compiles fine and produces nearly the desired
output. It should display 10 cards spread equally from left to right.
However, I find it extremely difficult to position the cards consistently,
as the center of the Gnome.Canvas is the origin. Using some basic math
should work to reposition the cards with negative coordinates, but this is
where I discover a strange bump in the Canvas's behaviour: The (0,0) origin
seems to be displaced by 100 pixels to the east.
To see this behaviour, load the attached sample and move a card (say, the
leftmost one) so it just touches the left border. The CanvasItem.GetBounds
is used to display the coordinates of the CanvasItem, whose Anchor is
NorthEast.
My window is 820 pixels in size, and for the left boundary it displays -360.
When I move the card so it just touches the right border, it should display
360 as the right boundary x coordinate. However, it displays 460.
The correct coordinate for both should be -410, 410 respectivly.
So in both cases its off by 50. This means, the (0,0) origin of the Canvas
is 50 pixels to the right. Maybe its also off in height, I have not checked.
This 50 pixel displacement is consistent at any scale (you can change the
"XXX" marked scale factor), therefore I do not think its a miscomputation or
misuse of Canvas in my code.
Is there some magic or even just documentation ;) I missed?
ciao,
Sebastian
--
-. scut@nb.in-berlin.de -. + http://segfault.net/~scut/ `--------------------.
-' segfault.net/~scut/pgp `' 5453 AC95 1E02 FDA7 50D2 A42D 427E 6DEF 745A 8E07
`- W88 heads sold. 4 payloads ready, payment due. hi echelon! ---------------'
--Q68bSM7Ycu6FN28Q
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="weirdGnomeCanvas.tar.gz"
Content-Transfer-Encoding: base64
H4sIANDTsD8AA+06C3Qb1ZV3RrYsjS2TkYnj/F+chEixLUt2EkNMSOw4cQyxCVYg/kCTsTS2
hWWN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