Hi André, André Ávila <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
