You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Mathias Schroeder <ms...@rostock.igd.fhg.de> on 2003/10/29 19:34:36 UTC

Mouse Dragging on JSVGCanvas

Hello,

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?
 
thanks for any help

Mathias Schroeder

Re: ViewBoxTrasformations

Posted by Mathias Schroeder <ms...@rostock.igd.fhg.de>.
> Mathias Schroeder wrote:
>
> > with certain SVGs the JSVGCanvas changes the ViewBox-Matrix to fit with
the
> > Canvas size, if the Canvas size changes. How could i stop that or how am
i
> > able to alter the ViewBox Matrix, because there is no
setViewBoxTransform()
> > method.
> > (i am using java)
>
> Hi Mathias,
>
>     You need to override the JSVGComponent.updateRenderingTransform
> method.  You will mostly just be stripping out code.
>

works perfect now thanks a lot :-)


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: ViewBoxTrasformations

Posted by Thomas DeWeese <Th...@Kodak.com>.
Mathias Schroeder wrote:

> with certain SVGs the JSVGCanvas changes the ViewBox-Matrix to fit with the
> Canvas size, if the Canvas size changes. How could i stop that or how am i
> able to alter the ViewBox Matrix, because there is no setViewBoxTransform()
> method.
> (i am using java)

Hi Mathias,

    You need to override the JSVGComponent.updateRenderingTransform
method.  You will mostly just be stripping out code.



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


ViewBoxTrasformations

Posted by Mathias Schroeder <ms...@rostock.igd.fhg.de>.
Hello again,

with certain SVGs the JSVGCanvas changes the ViewBox-Matrix to fit with the
Canvas size, if the Canvas size changes. How could i stop that or how am i
able to alter the ViewBox Matrix, because there is no setViewBoxTransform()
method.
(i am using java)


thanks
Mathias Schroeder


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Mouse Dragging on JSVGCanvas

Posted by Thomas DeWeese <Th...@Kodak.com>.
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: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Mouse Dragging on JSVGCanvas

Posted by Mathias Schroeder <ms...@rostock.igd.fhg.de>.
> > 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





---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Mouse Dragging on JSVGCanvas

Posted by Thomas DeWeese <Th...@Kodak.com>.
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)?



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org