hi!

i'm stuck trying to zoom via JS with the center staying the same.
here's my current approach that works sometimes (i couldn't make out
the system behind it):

function zoom(offset) {
        if (offset < 0)
                offset = -1/offset;

        svgdoc.currentScale *= offset;

        svgdoc.currentTranslate.x = svgdoc.currentTranslate.x*offset + (1 -
offset)*getInnerWidth/2;
        svgdoc.currentTranslate.y = svgdoc.currentTranslate.y*offset + (1 -
offset)*getInnerHeight/2;
}

where offset is 1.5 for +50% and -1.5 for -50%.
sometimes it will mess up the center point.

any help would be greatly appreciated!

regards,
karim




------------------------ Yahoo! Groups Sponsor --------------------~--> 
AIDS in India: A "lurking bomb." Click and help stop AIDS now.
http://us.click.yahoo.com/VpTY2A/lzNLAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to