Vicnent Snijders wrote:
Hi,
A bug was reported that TCanvas.Rectangle is incompatible to Delphi, but
somebody suggested that this was rather a Delphi bug.
For the complete story see:
http://www.freepascal.org/mantis/view.php?id=8342
In a note I wrote:
The canvas routines in Delphi are inspired by the winapi for device
contexts. See http://msdn2.microsoft.com/en-gb/library/ms533879.aspx [^]
for the winapi documentation. It states that "The rectangle that is
drawn excludes the bottom and right edges."
Somewhere else this is explained as nRightRect-nLeftRect should be
considered as width.
It is an easy to make this method work Delphi compatible by removing the
+1 in TWin32WidgetSet.Rectangle. But I hesitate to do, because I don't
know how many Lazarus code depends on the Delphi incompatibility.
The questions to be answered are:
Should LCLIntf.Rectangle do the same as Windows.Rectangle?
Should TCanvas.Rectangle(0,0,1,1) draw an 1x1 (as Windows.Rectangle
does) rectangle or a 2x2 rectangle (as Lazarus does currently)?
What is the current behavior for other widget sets?
So what do you think?
I'm the person who reported the supposed bug. But after the explanation
of a peer, i agreed that was a bug/misbehavior of Delphi. So i'm
favorable as not considerating as a bug but as a "difference" that
should be considered when porting a Delphi app. I think that we should
follow Delphi as close as possible (I'm porting a rather complex Delphi
software) but when we found that _clearly_ is a bug or misbehavior, or
cannot be done in a cross platform way, we should be free to do our way
(what we think is the best way).
As an example, i can cite that i would like to see an GetObject
crossplatform implemented, but after some research i found that is not
feasible and there's a need to do it in another way.
So, in resume, i think that more important than getting the LCL to work
_exactly_/bit per bit as Delphi/win32 is to document the differences
between them.
Luiz
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives