[interfacekit] Re: White Hat Hacking
- From: Isaac Yonemoto <ityonemo@xxxxxxxxxxxx>
- To: Cedric Degea <cdegea@xxxxxxxxxxxxxxxx>
- Date: Sat, 9 Feb 2002 14:49:55 -0600 (CST)
> Especially, the BRect::Width() accessor is kind of vicious. Well
> maybe it's just me but I'd expect it to return either the
> width of the inner rectangle (excluding the pixels that are part
> of the bouding box) or the width or the whole rectangle (previous
> value +2), but not a value that is neither the first nor
> the second, but exactly inbetween, and has to be ++'ed each
> time you want to use it...
Nope. BRect::Width() outputs a float (hence ++ is meaningless). Be's
rectangle/graphics rendering system is extremely powerful precisely
because it is subpixel precise, and the cleanest way (IMHO) to do
subpixel-precise stuff is to have the coordinate system be in the center
of the pixel, instead of at the edge.
Otherwise, if you have 1.000000000001 (exaggerating) then it won't show up
in the pixels you really want, and floats tend to do wierd things here and
there. MMX doesn't even guarantee that floating point operations produce
the same answer twice.
Isaac
- References:
- [interfacekit] Re: White Hat Hacking
- From: Cedric Degea
Other related posts:
- » [interfacekit] White Hat Hacking
- » [interfacekit] Re: White Hat Hacking
- » [interfacekit] Re: White Hat Hacking
- » [interfacekit] Re: White Hat Hacking
- » [interfacekit] Re: White Hat Hacking
- » [interfacekit] Re: White Hat Hacking
- [interfacekit] Re: White Hat Hacking
- From: Cedric Degea