xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Pan and Zooms being clipped.
Date Tue, 06 Apr 2010 12:17:45 GMT
Hi Jacob,

> > Jacob Christophersen <jacob.christophersen@gmail.com> wrote on 
04/06/2010 06:54:55 AM:
> >
> > > I'm struggling with the issue that when ever I try to pan or zoom
> > > out, the parts of the SVG that were not visible before the
> > > interactor started, are not shown again until I release the mouse.

>  Thomas DeWeese wrote:

> >   Correct, there is no simple way to avoid this.  In order to have
> > good performance the interactors simply scale/translate/rotate the
> > previous offscreen buffer.

Jacob Christophersen <jacob.christophersen@gmail.com> wrote on 04/06/2010 
07:47:49 AM:

> So would I be able to, for example, set the viewBox = "100 100 200
> 200", that I could then move the viewBox to other areas smoothly
> within the 400 x 400 root element?

    I don't think so.  The problem has nothing to do with viewBox
(zooming and panning the canvas do not effect the viewBox) it has to
do with the size of the offscreen buffer in the canvas.  It might be
possible to make the offscreen buffer in the canvas larger but that
get's really inefficient really quickly, and would slow down all
drawing operations.

> And if that is possible, would I just override the
> AbstractPanInteractor methods to manipulate the viewBox?

    Yes, you can create your own version of the Interactors, and in
your version you can manipulate the viewBox, or _much_ better simply 
update the rendering transform on the canvas (setRenderingTransform) 
however due to my previous statement:

> > For most SVG documents the time to render
> > them from scratch is far too long to update the screen smoothly during
> > pan/zoom operations.

     I don't think you will get 'smooth' updates, although that
depends on the SVG document and the computer in question.


Mime
View raw message