xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Ávila <asan...@nextech.com.br>
Subject Re: Problem transforming overlay when JSVGCanvas size changes
Date Tue, 02 May 2006 17:22:46 GMT
Hi Thomas,

I'm doing exactly what you suggested, getting the rendering transform in the
paint() method. It works fine for zooming, panning, etc, but it doesn't work
for resizing the canvas.

I'm actually looking at the AffineTransform returned by
getRenderingTransform()  when I resize the canvas and see that it is the
identity matrix. The rendering transform seems to be set only when I
interact with the canvas. Is this the expected behavior?

Just to clear things up, when I say I resize the JSVGCanvas, I mean I resize
the applet window that contains the canvas. Maybe there's something else
going on?

----- Original Message ----- 
From: <thomas.deweese@kodak.com>
To: <batik-users@xmlgraphics.apache.org>
Cc: <batik-users@xmlgraphics.apache.org>
Sent: Tuesday, May 02, 2006 1:43 PM
Subject: Re: Problem transforming overlay when JSVGCanvas size changes


> Hi Andre,
>
>         When a resize happens it just potentially updates the rendering
> transform.
> To be safest you should get the rendering transform in your paint method
> and not
> try and cache it.
>
> André Ávila <asantos@nextech.com.br> wrote on 05/02/2006 09:39:03 AM:
>
> > Hello,
> >
> > I added some drawing capabilities to my app. The user can draw Java2D
> shapes
> > on top of an SVG document. The SVG is rendered in a JSVGCanvas and the
> user
> > draws the shapes in an Overlay added to that canvas. Everytime the user
> > interacts with the canvas (zomm, pan, rotate), I get the canvas
> rendering
> > transform and apply it to the shapes in the Overlay. The code is pretty
> > straight forward, and it looks almost identical to the one in
> > TextSelectionHighlight.SelectionOverlay.
> >
> > Everything works fine, except for one glitch. Everytime the JSVGCanvas
> is
> > resized, the shapes are not transformed accordingly. They are drawn
> exactly as
> > before, meaning they get misplaced and not scaled. This doesn't happen
> with
> > the SelectionOverlay. If you select a text in an SVG and resize the
> canvas,
> > the selection will be resized accordingly.
> >
> > So, my questions are: what transform is applied to JSVGCanvas when it's
> > resized? How can I apply that same transform to the shapes in my
> Overlay?
> >
> > Many thanks in advance for any ideas!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>


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