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 Sachin Gupta <sa...@gmail.com> on 2009/09/22 07:51:08 UTC

Scrollbar not working while dragging

Hi,


While dragging any object on canvas if it we drags it beyond the bounds of
the view box ideally the scrollbar should scroll.
but it is not happening in my situation.
Can anybody please help me how to implement it.

Thanks,
Sachin

Re: Scrollbar not working while dragging

Posted by th...@kodak.com.
Hi Sachin,

Sachin Gupta <sa...@gmail.com> wrote on 09/22/2009 01:51:08 AM:

> While dragging any object on canvas if it we drags it beyond the 
> bounds of the view box ideally the scrollbar should scroll.
> but it is not happening in my situation.

   Right, Batik has no way to know that you are currently in
a 'drag' operation so it can't automatically perform actions 
like this.

> Can anybody please help me how to implement it.

   The JSVGScrollPane will automatically track changes to
the rendering transform (setRenderingTransform).  So if 
you are dragging and the cursor is near the edge of the
Canvas you can modify the rendering transform so the
document pans (by adjusting the translate X/Y).  Just
keep doing that every so often if the cursor stays near
the edge of the canvas.