|
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!
|
- Problem transforming overlay when JSVGCanvas size changes André Ávila
- Re: Problem transforming overlay when JSVGCanvas siz... thomas . deweese
