Re: Get current canvas position
- From: "Till Harbaum / Lists" <lists harbaum org>
- To: goocanvas-list gnome org
- Subject: Re: Get current canvas position
- Date: Mon, 13 Oct 2008 12:52:52 +0200
Am Montag 13 Oktober 2008 schrieb Till Harbaum / Lists:
> So my solution is indeed to store the scroll position locally.
Which just turns out to be not so trivial when you change the zoom.
Since the canvas zooms centered and the scroll position is the upper
left corner, you'd have to adjust the saved scroll position when you are
changing the zoom. I haven't yet found out how to do this correctly,
but it seems i have to determine the currently displayed canvas width and
and height and add/subtract half of this from/to the saved scroll offset ...
kinda ugly ... very ugly ...
Isn't there a way to request the current scroll offset from the canvas?
Perhaps a window2world on 0,0?
] [Thread Prev