xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: JSVGCanvas resizing transform
Date Wed, 10 May 2006 00:49:01 GMT
Hi André,

André Ávila <asantos@nextech.com.br> wrote on 05/09/2006 05:34:41 PM:

> Now, my problem is that, when the JSVGCanvas gets resized, the document 
is 
> transformed to fit in the entire new area. This means that, if the 
canvas' 
> size is reduced, the document is scaled down, and so on. This is the 
default 
> Batik behavior.

   Ok, now I understand the issue.  You need to use the 'viewing 
transform'
(JSVGComponent.getViewingTransform()) the problem is that I'm not sure you
can hold the data in 'screen space' like you more or less currently are.
You will have to transform the drawing in screen space to the viewBox 
(aka the SVG element's user space) in order for the drawing to stay 
consistent
(likely the cause of the 'drift' you mention below).

   This sort of underscores for me anyway that your overlay data should 
probably just be made part of the SVG document (at least once the 
interactive
drawing part is done) that way you wouldn't have to worry about _any_ of 
this
nonsense.

> I would like to use the same approach I described above to keep my 
overlay's 
> shapes in synch with the canvas when it is resized. However, I was not 
able to
> determine which AffineTransform is applied to the canvas. 
> 
> I got to a very close effect by messing with the viewBox transform, but 
the 
> synch is not perfect (the shapes always get a little displaced) and the 
amount
> of code for doing that is really disturbing. If I could just grab the 
> AffineTransform applied to the canvas in a resize operation, that could 
be 
> accomplished with 2 lines of code. 
> 
> Any ideas will be most welcome.

---------------------------------------------------------------------
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