Hi, Matthias
Thanks,  
I just tested it, It is really better.

Miles





----- Forwarded Message ----
From: Nitro <[email protected]>
To: Mailing List for the wxPython Float Canvas. <[email protected]>
Sent: Friday, April 17, 2009 2:47:03 PM
Subject: Re: [fc] It runs slow to drag on screen to create lines.

Am 17.04.2009, 20:31 Uhr, schrieb Miles Lee <[email protected]>:

> Hi, there,
> I'm new to floatcanvas and wonder if I'm on the right way,
> here are my codes which are very similar to the simple line
> drawer in the floatcanvas2 demo.
>
> class LinesDrawer(object):
>   def __init__(self, canvas):
>
>        self.lines = None
>        self.canvas = canvas
>
>        canvas.subscribe(self.onLinesBegin, 'input.left_down')
>        canvas.subscribe(self.onLinesDrag,  'input.move')
>        canvas.subscribe(self.onLinesEnd,   'input.left_up')

First update SVN (I've just committed a small change to handle a  
millisecond -> second conversion issue in the default update policy), then  
put this line here:

canvas.updatePolicy.interval = 0.02

Basically the default updatePolicy of the canvas doesn't render faster  
than 0.05s (20 fps). If you set it to 0.02s it will render 50 fps per  
second which should be much smoother.
There might also be a little issue where the line rendering lags 1 main  
loop iteration behind the change, but that's not really noticeable.

-Matthias
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas



      
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to