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 Tue, 19 Sep 2006 08:39:35 GMT

Hi Thomas,

> But this is just a problem with your calculation of rendering 
> transform. 

>  Right because a zoom w/o any translate keeps the upper left hand corner 
> 'pinned' so when you zoom out your upper left corner stays the same but 
> the amount across and down increases so it now shows content past the 
> old right and bottom edges. 

Yes thomas. there is the problem in my code in finding transform value. I
have tried to find the tranlation value using available size and scaled
size. But still i couldn't resolve my problem in finding transform. So can
you please suggest me that where i am doing mistake. Please find the
following code so that you can find the problem easily.

AffineTransform rat = getRenderingTransform();
AffineTransform at = null;

if (_zoomInflag) {
      at = AffineTransform.getScaleInstance(1.1, 1.1);
}
else if (_zoomOutflag) {
      at = AffineTransform.getScaleInstance(.9, .9);
}
else {
     return;
}


AffineTransform t1 = new AffineTransform(at);
t1.concatenate(rat);

AffineTransform vbt = getViewBoxTransform();
Rectangle2D viewBox = getViewBoxRect();
Rectangle originalSize = vbt.createTransformedShape(viewBox).getBounds();

Rectangle changedSize = t1.createTransformedShape(viewBox).getBounds(); 

int tx = 0, ty = 0;
tx = originalSize.x - changedSize.x;
ty = originalSize.y - changedSize.y;
            
t1.preConcatenate(AffineTransform.getTranslateInstance( -tx, -ty));
setRenderingTransform(t1);

Thanks in advance.

Regards,
Selva
-- 
View this message in context: http://www.nabble.com/Transform-problem-while-zoom-out-tf2276756.html#a6384084
Sent from the Batik - Users mailing list archive 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