Re: Set a zooming-strategy to an SVGCanvas
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, >> The example application and SVG file are attached to this mail. > > I didn't see them show up as attachments. Damn. I forgot the attachments.... Included in this mail now. :-) >> When the application starts, the image is always displayed as expected. >> But when extending the width of the window, the image starts beginning >> to >> move out of the canvas on the top. Addionally when lowering the width of >> the window, the image starts to move down inside the canvas (not staying >> in the top left corner). > > Do you have 'recenterOnResize' enabled? That might react badly to your > reimplementation of calculateViewingTransform. Yes, recenterOnResize was enabled. But if I set recenterOnResize=false, nothing gets scaled at all! (And I don't know why. It seems I really have to view through some implementation details in JSVGCanvas.) >> 2. What am I doing wrong here (or where is my misunderstanding)? > > It is very easy to make small mistakes in the calculation of > AffineTransforms > that can lead to effects like this. Resize is especially tricky because > it requires a > trip through the SVG Document event handlers and it's complex to get the > viewing > transform and the display transform to behave sensibly. Actually, I thought what I am doing would't be that tricky, because my current implementation is far from complex. Well, it is now attached. Maybe you see my mistake. :-) Regards Marco --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
scaletest.svg
(image/svg-xml, 5.4 KB) - not displayed
ScaleTest.java
(application/octet-stream, 1.5 KB) - not displayed