Re: [AD] About colors

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-06-14, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> On Mon, June 14, 2010 2:45 pm, Pavel Sountsov said:
> >> Which change do you mean?
> >>
> >> rect(x, y, x + w, y + h) makes the most sense to me the way it is in
> > A5,
> >> the A4 way meant the rectangle was not w/h but w-1/h-1 which easily
> > led
> >> to off-by-one errors.
> >
> > Yes, I suppose it does to me to. But, in that case, why not do have
> > rect(x, y, w, h) to remove the last bit of confusion?
> >
> > I don't actually have a preference myself, as long as the outline
> > rectangle convention matches the filled rectangle convention.
> 
> The A4 way makes more sense. You got it wrong. In A4 the call
> rect(screen, 10, 10, 12, 12, white); will draw a rectangle with
> top and left lines at pixel 10 and bottom and right lines at pixel
> 12.

No, it also makes perfect sense if you think of a pixel as a 1x1 square.
To fill the square you need to start drawing from (x1,y1) and keep
drawing right up to the other corner of the pixel at (x1+1, y1+1).

I believe this way of thinking extends to 3D more naturally.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/