Hi onedelacruse,

onedelacruise <[EMAIL PROTECTED]> wrote on 09/06/2007 06:30:58 AM:

> how do i limit zooming and panning? limit meaning if panning, the white 
empty
> space will not be shown and zooming meaning the svg can only be zoomed 
out
> until the whole svg is seen. i read that setRenderingTransform must be
> overriden but i looked at the code and i do not know where to start..

   The Rendering Transform controls what part of the infinite canvas
is visible.  You can calculate what part of the canvas will be shown
for any rendering transform by mapping the corner points of the canvas
(0,0), (canvasWidth,0), ... through the inverse of the 'Viewbox 
transform',
which is the concatenation of the rendering transform and the viewing
transform if any:
        AffineTransform at = getRenderingTransform();
        if (at == null) at = new AffineTransform();
        else            at = new AffineTransform(at);
        AffineTransform vt = getViewingTransform();
        if (vt != null) {
            at.concatenate(vt);
        }

   You will then need to adjust the rendering transform to pull those
points inside your 'active area'.

> and how can i activate panning/zooming by button and mouseclick? thanks

   See the scrollAction/zoomAction classes in JSVGCanvas.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to