Mattias Gaertner wrote:

On Sat, 07 Jan 2006 13:55:33 +0200
Markku Niskanen <[EMAIL PROTECTED]> wrote:

Canvas.Arc(iMin,jMin, iMax,jMax, x1, y1, x2,y2);
Windows.Arc(Canvas.handle,iMin,jMin, iMax,jMax, x1, y1, x2,y2);
Oh dear me!  I finally noticed that the Lazarus Arc differs from
the rest of the world. In Windows API and Delphi the coordinates
are rectangle coordinates and in Lazarus it is

TCanvas.Arc(Left,Top,AWidth,AHeight,sx,sy,ex,ey : Integer);

in Delphi this is:

procedure Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);

And Windows API:

BOOL Arc(
 HDC hdc,         // handle to device context
 int nLeftRect,   // x-coord of rectangle's upper-left corner
 int nTopRect,    // y-coord of rectangle's upper-left corner
 int nRightRect,  // x-coord of rectangle's lower-right corner
 int nBottomRect, // y-coord of rectangle's lower-right corner
 int nXStartArc,  // x-coord of first radial ending point
 int nYStartArc,  // y-coord of first radial ending point
 int nXEndArc,    // x-coord of second radial ending point
 int nYEndArc     // y-coord of second radial ending point
);

for some reason unknown to me. This explains the weird behaviour of
a graphics application I tried to port from Delphi

Is there any special reason for one of the primitives to have a different
parameter list?

Probably the initial implementer didn't know that.
This should be changed.
Please report this as bug, so it won't be forgotten.

I'm rewriting the method to the Delphi like format. It is already done for the above method but there are two methods Arc in canvas.inc. The second method is TCanvas.Arc(Left,Top,AWidth,AHeight,angle1,angle2 : Integer); Shall I convert this method to TCanvas.Arc(Left,Top,Right,Bottom,angle1,angle2 : Integer);

Martin.

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to