Re: Why floating point for widget positions



On Tue, 22 Mar 2005 16:12:09 -0500, Tristan Van Berkom <tvb gnome org> wrote:
> Mike Emmel wrote:
> > I've noticed that the GdkEventMotion x y positions are given in
> > floating point coordinates and was wondering why ?
> 
> I'd assume that this is just because xlib delivers the value
> as `double'.
> 
> > I've looking at GTK for embedded use and this is and issue.
> 
> How is floating point coordinates a problem ?
> 

No floating point unit so any floating point math runs through a
emulation library and is generally slow.
> Btw,
>      if you are trapping GdkEventMotion you can use:
> http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-get-pointer
> on widget->window for an integer version of the mouse location. 

One reason I wondered why it was float in the first place since in all
the use cases it seemd to be chomped back to a int.
> 
> Cheers,
>                    -Tristan
> 
>



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