[fpc-devel] Slight calculation error in Bounds() procedure in Classes unit.

Martin Schreiber fpmse at bluewin.ch
Wed Jun 9 14:32:08 CEST 2010


On Wednesday 09 June 2010 11:30:21 Graeme Geldenhuys wrote:
> Op 2010-06-09 11:02, Florian Klaempfl het geskryf:
> > interpretation of bounds, the current behaviour is perfectly valid for
> > any other uses.
>
> Not as I see it, and described in the bug report. Think of the pixel
> screen/grid like the grid of a spreadsheet (as as a magnified look of the
> top corner of your screen)
>
[...]
I think you are wrong, TRect has been defined in order to communicate 
rectangles to GDI routines (FillRect(),CreateRectRgnIndirect()...):
http://msdn.microsoft.com/en-us/library/aa932720.aspx
"
When filling the specified rectangle, FillRect does not include the 
rectangle's right and bottom sides. 
GDI fills a rectangle up to, but not including, the right column and bottom 
row, regardless of the current mapping mode.
"
http://msdn.microsoft.com/en-us/library/aa932835(v=MSDN.10).aspx
"
The region will be exclusive of the bottom and right edges. 
"

Because of the ambiguity MSEgui uses solely the "rectty" type:
"
 rectty = record
           case integer of
            0: (x,y,cx,cy: integer);
            1: (pos: pointty; size: sizety);
          end;
"

Martin



More information about the fpc-devel mailing list