[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] About colors
- From: "Trent Gamblin" <trent@xxxxxxxxxx>
- Date: Mon, 14 Jun 2010 15:06:23 -0600 (MDT)
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. I'm in favor of using width and height instead though, to
avoid confusion. But if we're going to use x2/y2, then having the
bottom and right lines fall on x2-1, y2-1 makes no sense.
Trent :n)