Re: [java-gnome-hackers] org.gnome.gdk.EventButton.getX()/getY(): double vs int
Brought to you by:
afcowie
From: Srichand P. <sri...@gm...> - 2008-10-08 05:13:53
|
On Mon, Oct 6, 2008 at 2:14 PM, Stefan Prelle <st...@pr...> wrote: > Hi all, > Hi Stefan, I just stumbled upon the not yet exposed methods getX() and getY() > in org.gnome.gdk.EventButton and Andrew's comment: > > * I'm not exposing these yet; why on earth are they double? If there's > * no good reason or it's legacy crap, we're going to change the return > * signature to int. > > I agree that I don't see a point in not having integers here. So, if > noone is coming with a good example why to use doubles here, I suggest > that we expose them as ints. > > Any comments? > > Stefan > > There certainly are useful applications where doubles rather than ints would be useful. I've been working on some research on pen strokes on touchscreen surfaces, such as tablet PCs, external USB tablets (Wacom style stuff) and handheld devices. For a lot of the algorithms, subpixel accuracy is certainly useful. By constraining values to ints, you're losing (possibly) valuable bits of information. Instead of deciding which pixel to select (by truncating the numbers after the decimal), sometimes its useful to let the application/algorithm decide what it wants to do. Just my 2c. Srichand -- Srichand Pendyala http://srichand.net.in/ |