Hello,

I have a feeling I am making this harder than it needs to be. Here is what I am trying to accomplish. I would like to create a method by which I can increase or decrease the scale on the root element while maintaining the drawings current position on the screen.

For example, If in the user coordinate system the point -300,400 is in the center of my monitor after I change the scale I would like the point -300,400 to still be in the center of the monitor.

Here is an example of the code I am trying to do this with:
/*The variable SVGDoc is obtained through the JSVGCanvas.getSVGDocument() method*/
private void setScale(double factor){
double currentScale;
float s;


       currentScale = SVGDoc.getRootElement().getCurrentScale();

       if(factor != 0){
           s = (new Float(currentScale * factor)).floatValue();
           SVGDoc.getRootElement().setCurrentScale(s);
       }
   }

This works fine, except the position of the drawing on the screen is changed. I should note - I have setRecenterOnResize set to false and the JSVGCanvas is contained in a JSVGScrollPane.

I apologize if this has been covered elsewhere. I searched the mail list archives, but was unable to find an answer. Any help is greatly appreciated.

Thank you,
TJ Teegan

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to