Re: [AD] new GUI focus selection algorithm

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Mon, 2003-11-17 at 10:57, Eric Botcazou wrote:
> > Ok, the attached patch implements it. Instead of using 0x10000 when
> > wrapping around at the edges, I used SCREEN_W and SCREEN_H - since we
> > already know that 'screen' is the bitmap the GUI is drawn to, I think
> > this is quite a safe assumption about the GUI size.
> 
> What does this buy us? Nothing I'd say, and now we have further tied the GUI 
> engine to the screen bitmap.

Well, in certain cases (and if the dialog fills the entire screen), it
would wrap instead of taking a dialog which is left on the same side.
But I was having the same doubt - so since we don't know the GUI
dimensions, 0x10000 is better.

> Two remarks:
> - I think that using the Euclidean distance is too costly in terms of ratio 
> benefit/overhead. After all, all distances are (mathematically) equivalent 
> and we don't care if our circles look like squares :-)
> - You should introduce a compile-time parameter in the distance formula so 
> that we can tweak the relative weight of the two axes.

Would a weight really be useful? I'm more thinking about just using
abs(x+y) instead of Euclidean.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/