Hi Chris, See below for answers,
Chris Kaye <[EMAIL PROTECTED]> wrote on 09/28/2008 09:04:53 AM: > I am trying to use SVGCanvas to display a SVG document which I have > built using the Batik API. I have both the zoom and pan interactors > enabled and they work fine. > > However, there are two things I would like to be able to do: > > 1) How can I prevent the zoom from reducing the transformed image below > a certain size. For example, if the document was displayed in full, I > would like to be able to zoom in to various sections of it, but not zoom > out beyond its original size? The Pan interactors simply manipulate the 'rendering transform'. You can intercept changes to the rendering transform by subclassing the Canvas and wrap or replace the setRenderingTransform method. If you haven't done anything else the initial rendering transform is the identity matrix so if you ensure that the scaling part of the matrix never goes below 1 you should have what you want. > 2) How, when panning the image to right, can I detect that the lefthand > edge of the image bounding box has reached the lefthand edge of the > viewport, and reset the panned position so that it now appears to pan in > from the left (wrap-around) and vice versa. Similarly, for panning up > and down? This can be accomplished by looking at the translate portion of the matrix. However If you want to be able to see the left and right sides of the same document at some point (i.e. as if the plane were tiled with the document) you need to do something more than just manipulate the rendering transform.
