xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Ávila <asan...@nextech.com.br>
Subject Re: Synchronizing JSVGCanvas
Date Fri, 31 Mar 2006 18:37:04 GMT
> André Ávila <asantos@nextech.com.br> wrote on 03/31/2006 11:48:06 AM:
>
> > Hi Thomas,
> >
> > I tried your approach. Much simpler than mine, indeed, but you actually
> lose
> > the dynamic behavior of the interactors. Only after the mouse is
> released,
> > the other layers are transformed.
>
>    Then you just need to do exactly the same thing with the
> 'setPaintingTransform' method.  This will make them all move in unison.

Ha! You're the man!

> > So, I'm moving on to the overlay idea. I'm thinking, to do that I'll
> have to
> > rasterize the svgs first, right?
>
>    If you manipulate the setPaintingTransform this will happen
> automatically.
> It will pan/scale/rotate/etc the offscreen bitmap rather than rerender the
> content.  Everything should be fairly quick unless you have huge canvases
> or
> many layers.

Yes, I'm afraid this is exactly the problem. The SVGs I deal with are really
complex, and the smaller ones have around 100KB (the bigger ones have more
than 10MB - enters the rendering with JGVTComponent). In fast machines the
synch is probably acceptable, although far from perfect. But in less
powerful ones, it gets really bad, even with only 2 layers of 100KB SVGs.

I'm thinking that maybe some sort of double buffering that would redraw both
canvases to the screen when they are already rendered could help.

> > And then, in the paint() method of the
> > original canvas, get the rendering transform of the canvas and use it to
> set
> > the transform on the raster. Does that sound ok?
>
>    It might be made to work, but setPaintingTransform is the way to go...

setPaintingTransform seems to work really fine in the general case of
decent-sized SVGs, but given the requirements I have I'll have to find
another solution. Thinking about the overlay, I just realized that will be
very difficult to keep the vector lossless scaling, since I'll be dealing
with a rasterization of an SVG. Oh, boy. Any other ideas are most welcome!

Many thanks again!


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


Mime
View raw message