xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selva <selvakumar_...@yahoo.co.in>
Subject Re: Transform problem while zoom out
Date Mon, 18 Sep 2006 05:10:56 GMT

Hi Thomas,

>   It looks to me like your calculation of the zoomOut transform is
> wrong (it always goes to the top/left corner).  This doesn't appear 
> to be a problem with the scrollbars, just your calculation of how
> to update the rendering transform.  You might want to look at how
> the JSVGCanvas calculates it's zoom in/out transform (it's in an
> inner class of Batik.swing.JSVGCanvas).

Initially i have used like ZoomOut/ZoomIn transform in JSVGCanvas. But later
i have changed this to following code without translate, since my
application doesn't need zoomout/zoomin based on the position.

AffineTransform rat = getRenderingTransform();
AffineTransform at = AffineTransform.getScaleInstance(.9, .9);
AffineTransform t = new AffineTransform(at);
t.concatenate(rat);
setRenderingTransform(t);

But after changed like this, i am zooming out the document to large scale.
After that i am moving the horizontal and vertical scroll bars to left and
bottom corners. Now if i tried to zoom out using "zoomout" button, document
translation is not proper. ScrollBars are supposed to stay in left and
bottom corners and document must display the corresponding translated
document. But here it is not translating properly. 

This is zooming out only the viewable portion not at all translating the
document based on the zoomed out size . If i change the scroll bar position,
i can able to view the proper document which i supposed to view. This
problem is happening with the following code as well which is in JSVGCanvas.

int x = e.getX();
int y = e.getY();
AffineTransform t = AffineTransform.getTranslateInstance(x, y);
t.concatenate(at);
t.translate( -x, -y);
t.concatenate(rat);
setRenderingTransform(t);

Please see my attached image. 
Image -1 is zoomed In image. After zoomedIn, i have moved the scroll bars to
right bottom corner.
Image -2 is zoomed out image. But here document is not translated properly.
It is zooming out the image portion only in the viewable area. But it show
scale and translate like image - 3. But after changing the scroll bar, it is
translating properly.

Please let me know if i didn't give enough information about my problem and
how to calculate the translate transform for zoomout. 

Thanks,
Selva

http://www.nabble.com/user-files/236061/zoomout_problem.jpg 


-- 
View this message in context: http://www.nabble.com/Transform-problem-while-zoom-out-tf2276756.html#a6357826
Sent from the Batik - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message