Re: Is (x,y) int or double?



>How come that in GdkEventMotion the x and y coordinates are of type
>gdouble, but in the function gdk_window_get_pointer() the x and y
>coordinates are of type gint.
>
>Yet, in GGAD (still the best documentation) this is the example:
>
>  double x, y;
>
>  x = event->motion.x;
>  y = event->motion.y;
>
>  if (event->motion.is_hint)
>    gdk_window_get_pointer(event->window, &x, &y, NULL);
>
>I thought the idea with double as coordinates was for input devices that
>are more fine grained then the normal mouse. But then this extra precision
>is lost if you use gdk_window_get_pointer().

no precision is lost, since pointer coordinates are always
integral. only if you had a window whose size in at least one
dimension was >INT_MAX but <DBL_MAX would this make any
difference. this is unlikely, to say the least.

however, i agree with you that the inconsistency is a bit off putting.

--p




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