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 philip zuniga <ph...@gmail.com> on 2006/06/01 06:24:22 UTC

Canvas not updating properly

Hello,

I am currently working on an SWT application that is embedded with a JSVG
canvas. I based my work on some source codes that were posted in this
mailing lists. In the application, the canvas is translated every time I
move the scroll. The translation is done via the rendering transform of the
canvas (just like the same way as JSVG Scrollpane works). The process seems
to be logical. But when I run it and move the scroll, there are some times
(especially when I move the scroll quickly) when the canvas does not update
properly, and instead it just stays to its current position. But, if I move
the window of the application in a place where the canvas is hidden and show
it up again, then the canvas would be updated. Or, if i place the window
of another application over the canvas,and remove it, then the canvas gets
updated.

do you know where the problem is?


Philip

Re: Canvas not updating properly

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,
On Sat, 2006-06-03 at 00:01 +0800, philip zuniga wrote:
> Sir,  I am trying to understand everything that you say so forgive for
> asking a basic question.
>  
> 1) What is the difference between setting the rendering transform and
> setting the painting transform.

Below is the answer from Thomas regarding transform long time ago in
mailing list archive

>      JSVGCanvas.ViewBoxTransform

     This is a convenience function that combines the
Root Graphics nodes 'Viewing' Transform with the Canvas
Rendering transform.

 >      JSVGCanvas.InitialTransform

     This is currently almost always the Identity transform.
This is what the 'rendering' transform is set to when the
canvas 'resets' the Rendering Transform (i.e. original view).

 >      JSVGCanvas.PaintingTransform

     This is the transform used to draw the offscreen bitmap
on screen.  Most of the time is the Identity transform, however
when the user is panning the document or using interactive
zoom/rotate (or the JSVGScrollPane is scrolling) this is the
transform that is updated until the interactive update is
completed at which point the change is incorporated into the
rendering transform and the document is rerendered.

 >      JSVGCanvas.RenderingTransform

     This holds the result of all the users panning/rotating/zooming
of the document.
 
Regards
Tonny Kohar

-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


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


Re: Canvas not updating properly

Posted by philip zuniga <ph...@gmail.com>.
Sir,  I am trying to understand everything that you say so forgive for
asking a basic question.

1) What is the difference between setting the rendering transform and
setting the painting transform.




On 6/1/06, thomas.deweese@kodak.com <th...@kodak.com> wrote:
>
> Hi Philip,
>
> "philip zuniga" <ph...@gmail.com> wrote on 06/01/2006 12:24:22 AM:
>
> > I am currently working on an SWT application that is embedded with a
> JSVG
> > canvas. I based my work on some source codes that were posted in this
> mailing
> > lists. In the application, the canvas is translated every time I move
> the
> > scroll. The translation is done via the rendering transform of the
> canvas
> > (just like the same way as JSVG Scrollpane works).
>
>    Actually the JSVGScrollpane updates the painting transform while you
> are scrolling and only updates the rendering transform when you finish
> the scroll operation.
>
> > The process seems to be logical. But when I run it and move the scroll,
> > there are some times (especially when I move the scroll quickly) when
> > the canvas does not update properly, and instead it just stays to its
> > current position. But, if I move the window of the application in a
> > place where the canvas is hidden and show it up again, then the canvas
> > would be updated. Or, if i place the window of another application over
> > the canvas,and remove it, then the canvas gets updated.
> >
> > do you know where the problem is?
>
>   It sounds like you are loosing one or more of the 'internally'
> generated
> repaint events from the Canvas.  When you update the rendering transform
> the rendering of the Canvas is actually done in a separate thread to
> avoid 'locking up' the main UI thread.  When the rendering is completed
> it notifies the canvas which grabs the updated image to display (which
> seems to be working fine since if you manually generate an 'update'
> event it redraws correctly).  It then triggers a repaint of the canvas
> this part seems to be the problem part.
>
>   This is made a bit more complex by the fact that triggering many
> redraws quickly usually causes the earlier redraws to be canceled.
> I'm fairly sure that this is working in an AWT/Swing only world.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>

Re: Canvas not updating properly

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

"philip zuniga" <ph...@gmail.com> wrote on 06/01/2006 12:24:22 AM:

> I am currently working on an SWT application that is embedded with a 
JSVG 
> canvas. I based my work on some source codes that were posted in this 
mailing 
> lists. In the application, the canvas is translated every time I move 
the 
> scroll. The translation is done via the rendering transform of the 
canvas 
> (just like the same way as JSVG Scrollpane works).

    Actually the JSVGScrollpane updates the painting transform while you
are scrolling and only updates the rendering transform when you finish
the scroll operation.

> The process seems to be logical. But when I run it and move the scroll, 
> there are some times (especially when I move the scroll quickly) when 
> the canvas does not update properly, and instead it just stays to its 
> current position. But, if I move the window of the application in a 
> place where the canvas is hidden and show it up again, then the canvas 
> would be updated. Or, if i place the window of another application over 
> the canvas,and remove it, then the canvas gets updated. 
> 
> do you know where the problem is?

   It sounds like you are loosing one or more of the 'internally' 
generated
repaint events from the Canvas.  When you update the rendering transform
the rendering of the Canvas is actually done in a separate thread to
avoid 'locking up' the main UI thread.  When the rendering is completed
it notifies the canvas which grabs the updated image to display (which
seems to be working fine since if you manually generate an 'update' 
event it redraws correctly).  It then triggers a repaint of the canvas
this part seems to be the problem part.

   This is made a bit more complex by the fact that triggering many
redraws quickly usually causes the earlier redraws to be canceled.
I'm fairly sure that this is working in an AWT/Swing only world.


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