Hi John,

"John C. Turnbull" <[email protected]> wrote on 12/07/2008 05:26:58 
PM:

> I am trying to get an application to work that uses multiple SVG 
> canvasses which can overlap.  It all works surprisingly well (hats 
> off to the Batik developers!) except when an animation is happening 
> in the canvas under another canvas.  In this case, if I zoom in on 
> the top canvas and it?s a relatively complex SVG that takes a little
> while to re-render at its new size, the underlying animation shows 
> through during that time and the result is ugly.

   My guess is that you see the old top canvas contents until the
top canvas can complete it's rendering?  I guess my question is
what do you want to have happen?  Do you want all repaints to 
block until the top canvas rendering is complete?

> Similarly if the top canvas includes an object which can be 
> dragged, during the dragging similar behavior is observed and 
> results in a hideous battle between the animation and the top 
> SVG as to who gets to render at that time.

   This is probably a similar problem, when you drag we have to
re-render the old and new positions for the object.  While that
is happening, if a swing repaint request comes in we fulfill it
with the current contents of the offscreen buffer (and it should
get fixed when the dragged object is finished being updated).

> I have been trying hard to make modifications which would alleviate 
> this behaviour but I realised that I don?t even understand exactly 
> what is happening and why.  I would have thought that as the 
> underlying animation paints its component it would then need to 
> repaint anything on top of it but when that top object is resizing 
> or being dragged it seems to be unable to do this.  Curiously this 
> doesn?t happen if the top object is being translated by the left and
> right arrow keys.

    When you translate with the left and right arrow keys we update
the 'painting transform' so that the un-updated offscreen buffer
is correctly positioned, but you will notice that there is 'blank
space' where that buffer has moved away from the edge of the window.
You may not be aware that if you use 'shift mouse-2' we will scale
in a similar manner, and 'ctrl mouse-2' will rotate with painting
transform update.

> So why can?t the top object paint itself while it is being resized 
> or dragged?  Is something else going on?

   It can't paint itself with the updated rendering because 
it's busy making that updated rendering.  So the question is what
do you want to have happen while it's making that updated rendering?

Reply via email to