gnustep-dev
[Top][All Lists]
Advanced

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

Re: Graphics Rounding (was Re: Pixel-aligned autoresizing)


From: Philippe Roussel
Subject: Re: Graphics Rounding (was Re: Pixel-aligned autoresizing)
Date: Wed, 13 Jul 2011 09:14:43 +0200

Le mardi 12 juillet 2011 à 15:18 -0600, Eric Wasylishen a écrit :
> Hi,
> I committed the change which I proposed earlier, introducing the following in 
> GSGuiPrivate.h:
> 
> /**
>  * Rounds to the nearest integer, and in the case of ties, round to the 
>  * larger integer. This is the recommended rounding function for rounding
>  * graphics points.
>  *
>  * For example:
>  * GSRoundTowardsInfinity(0.8) == 1.0
>  * GSRoundTowardsInfinity(0.5) == 1.0
>  * GSRoundTowardsInfinity(0.1) == 0.0
>  * GSRoundTowardsInfinity(-2.5) == -2.0
>  */
> static inline CGFloat GSRoundTowardsInfinity(CGFloat x)
> {
>   return floor(x + 0.5);
> }
> 
> and switching uses of rint[f] to this function. The jumping buttons in 
> SimpleAgenda are fixed now.

Thanks a lot for your work Eric.

Philippe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]