Re: gnome-canvas search item set with bounding box




Hello

On Wed, 24 Nov 1999, TANGE Toshio wrote:

> 
> I need function that select items in canvas widget with bounding box.
> like follow this.
> 

I see 4 problems, which are not easily addressed
- there seem (at least last time) not to be clear consensus, if bounds
should be in item or world coordinates
- last time I checked, bounds method was deprecated anyway
- You have to be sure, update is not pending, as bounds will be correct
only after updating
- bounds should return sufficent, not exact bounding box, which may be
confusing
Anyway, instead of using _get bounds method you can use item bounding box
stored in item object:
item->x1 etc.
These too are (almost) correct after updating. To make sure, update is not
pending, you can check canvas->need_update flag. But probably canvas does
not like invoking (as opposed to requesting) update from user program.
request_update simply sets flag and guarantees, that
gnome_canvas_item_invoke_update (root) will be called during canvas idle
loop, 

Myself, I ended with my own method bbox for solving similar problem.

L.




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