Re: gnome-canvas, large items, and MOTION_NOTIFY handling question



Hello!

You have correctly tracked down the problem.
If you do not need events, then you should just modify canvas item, to return
some very large distance for ::point() method. You didn't specify, whether you
use stock items, or created customs ones - you cannot do that with stock items
unfortunately. But you can just very simple subclass, that overrides ::point
method.
Also, if you need events, you can probably still speed your code up by
modifying ::point(). In current canvas ::point() is supposed to return distance
from point to object - there is little need for exact distance - for most cases
it is sufficent to determine, whether point lies on item, or outside it. Just
check, whether point is inside (using art_svp_wind or something) and return either
0 or 1000000... depending on result.
Hope that helps.

Best wishes,
Lauris Kaplinski


On 22 Feb 2001 14:10:16 -0500, Jan Hlavacek wrote:
> 
> Hi everybody,
> 
> I hope this is the right place to ask.  I am writing a little
> application that uses AA gnome canvas with rulers to track mouse
> position.  It works fine as long as I don't use too complicated items.
> However, in my application I need to use lines with several hundreds
> control points.  Every time mouse cursor enters the bounding rectangle
> of such item, the rulers start seriously laging behind the actual mouse
> cursor.  If I move the cursor several times accross the bounding
> rectangle, I can see the marks on the rulers slowly move around several
> seconds after the mouse cursor stoped. 
> 
> >From what I could figure out, I believe that this is caused by the fact
> that gnome canvas is trying to figure out whether a mouse cursor is over
> the line or not,  which is slow for complicated lines.  What I would
> like to know is this:  Is there any way to stop canvas from trying to
> send mouse events to its items?  Or is there some other way how to speed
> the canvas mouse tracking?  
> 
> BTW, i was able to recreate the same problem in sodipodi.  When you
> create very compicated free-hand line a move mouse cursor over it, the
> marks on the rulers slow down considerably. 
> 
> Thanks for any advice.
> 
> -- 
> Jan Hlavacek                                            (219) 434-7566
> Department of Mathematics                             Jhlavacek sf edu
> University of Saint Francis               http://www.sf.edu/jhlavacek/
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]