Re: Get current canvas position



Hi,

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?

Till


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]