Mathias Schroeder wrote:

i can drag my SVG over the Canvas, that works good so far.
But i don`t want to drag negative coordinates on the screen (or doing a
negative translation in generell).
How could i prevent this by the time i do the dragging?

How are you dragging? Are you using the built in 'pan' control (shift 1st mouse)? Or are you dragging SVG objects using Java(Script)?


Sorry, i think my question was a little confusing.
I`m using the build in pan control and i want that the svg can only be
dragged if the SVG is bigger than the Canvas ( after doing a zoom e.g.) to
be able to view the hole svg,
but i also don`t want that to drag so that (0,0) of the SVG is (0+x,0+y) of
the Canvas so i see "negative" SVG coordinates. How can this be done?
i hope its better to understand now


   You will want to replace/modify the existing PanInteractor.
Most of the Pan Interactor functionality is in
batik.swing.gvt.AbstractPanInteractor, with just a little bit
in batik.swing.JSVGCanvas (as an inner class).

   The new PanInteractor would limit the translation based on the
size of the canvas (getSize()) and the size of the document
in pixels:
getRenderingTransform().createTransformedShape(getGraphicsNode().getBounds())).getBounds();





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



Reply via email to