Just an update and or interesting information for users of Goo::Canvas. I have been messing with an application were the user can click on a map to insert a waypoint. The problem I was having was that when you zoom in and add a waypoint, the point would be off a distance. This increased greatly as you zoom in. Well using excel and some testing I think I found a correction factor for this zoom error:
z = zoom in percent (ex 100) x0 = x pixel of real pixel y0 = y pixel of real pixel x = x pixel of fake pixel y = y pixel of fake pixel x0 = (100*(x+0.6105))/z y0 = (100*(y+0.2526))/z
I don't know if this is dependent on the starting canvas size or not. I do encourage users to test this correction and see if it works for other situations. If this needs to be moved somewhere else let me know, I just put it in the most familiar place.

Replies are listed 'Best First'.
Re: Goo::Canvas zoom correction
by zentara (Cardinal) on Apr 05, 2009 at 13:07 UTC
    I worked on that awhile back, and this is what I came up with for centering on waypoints ..... it may not be perfect, but it works, and also incorporates scale....which you really need to deal with.. I just came up with the algorithm by guessing. :-) .... so there may be a better way. HTH..... I'm fading out of this stuff...of course I was tempted to use my Goo Canvas and transparent images to simulate the flight of that typo dong 2 missle. Would work perfect. :-)

    See

    Also of interest to centering would be:


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku