Hi all,

if any one has an idea, the following procedure when executed as
native FPC is working as expected. But when executed with pascal
script, the Rectangle procedure is in fact drawing a square where x1,
y1, x2, y2 are all ok except that y2 acts like if it was y2 := x2.

procedure DrawCore(bitmap: TBitmap; aTop, aLeft, aWidth, aHeight: Integer);
var
 w: Integer; //test
 h: Integer; //test
begin
 w := StrToInt(IntToStr(aWidth-1));
 h := StrToInt(IntToStr(aHeight-1));
 with bitmap.Canvas do
 begin
   Pen.Color := clRed;
   Rectangle(aLeft, aTop, h, w);
   Rectangle(aLeft+2, aTop+2, h-2, w-2);

   MoveTo(aLeft+2, aTop+2);
   LineTo(w-2, h-2);
   MoveTo(aLeft+2, h-2);
   LineTo(w-2, aTop+2);

   Pen.Color := clNavy;
   Rectangle(aLeft, aTop, w, h);
   Rectangle(aLeft+2, aTop+2, w-2, h-2);

   TextOut(aLeft+20, aTop+20, 'Width:' + IntToStr(w+1));
   TextOut(aLeft+20, aTop+40, 'Height:' + IntToStr(h+1));
 end;
end;

So the clRed rectangle gives a big 300x300 square (going out of
visible area (i.e. 300 x 100).
The X draw with LineTo is ok, in visible area.
The clNavy rectangle is a small 100 x 100 square.

I have no clue of what is going on. I use latest svn of PascalScript.

--
Alexandre Leclerc

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

Reply via email to