xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Problem transforming overlay when JSVGCanvas size changes
Date Tue, 02 May 2006 16:43:31 GMT
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


Mime
View raw message