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 Problem transforming overlay when JSVGCanvas size changes
Date Tue, 02 May 2006 13:39:03 GMT

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!
View raw message