Re: Why floating point for widget positions



Michael Natterer wrote:
Because extended input devices produce coordinates
at sub-pixel positions.
Aha, interesting... Now, after I've read [1] and looked into the source, I see that GDK can translate XInput events to GDK_MOTION_NOTIFY events with coordinates that have a fractional part.

Can you provide an example of how floating point x,y coordinates from motion event can be used? Mike is right - every GTK widget uses type casting from double to int for them and this looks natural for the discrete displays.

[1] http://developer.gnome.org/doc/API/2.0/gdk/gdk-Input-Devices.html

	Olexiy




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