On 8/6/07, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
> So mathematically it's incorrect then. Coordinates (0,0) to (1, 1)
> only draws a 1x1 pixel rectangle. Even thought (0, 0) and (1, 1) is
> not the same position in a grid. Basically 1 less in width and height
> compared to the bottom right coordinate.
Actually this is debatable. Where does the pixel starts matematically?
At it's center?
If you have a square from (0, 0) to (1, 1), considering the center of
the pixels, the square will have only a 1x1 size =)
If the pixel is matematically at it's Top, Left position too. You only
get a 2x2 pixel if you set the pixel start at it's center and then
decide to fully paint all pixels that should actually be partially
painted.
And also remember that the current definition you can get the Width
and Height with:
Width := Left - Right
Height := Top - Bottom
If you change the definition of Rectangle this is no longer valid, and
this relation is mathematically correct AFAIK
> Why isn't TCanvas.Rectangle then defined as Rectangle(x, y, width,
> height) which would then clearly explain the current behavior?
> Currently it's odd.
Delphi compatibility
It's certainly not intuitive, but not odd. And that should be the task
of the documentation. To clarify unclear points. Unfortunately I'm
travelling tomorrow morning, so no time to update the docs now.
--
Felipe Monteiro de Carvalho
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives