Looking at the mentioned function i noticed that FLastChangeboundRect stores the width…
Show quoted text 12 lines
Looking at the mentioned function i noticed that FLastChangeboundRect
stores the width and height in Right and Bottom fields but is tested as
if was storing the bottom-right coordinates.
ARight:=ALeft+AWidth;
ABottom:=ATop+AHeight;
if (ALeft=FLastChangeboundRect.Left)
and (ATop=FLastChangeboundRect.Top)
and (ARight=FLastChangeboundRect.Right)
and (ABottom=FLastChangeboundRect.Bottom)
then exit;
FLastChangeboundRect:=Rect(ALeft,ATop,AWidth,AHeight);
Strange, that this was not spottet earlier.
Show quoted text 20 lines
I would change the above code to
//removes ARight and ABottom variables
if (ALeft=FLastChangeboundRect.Left)
and (ATop=FLastChangeboundRect.Top)
and (AWidth=FLastChangeboundRect.Right)
and (AHeight=FLastChangeboundRect.Bottom)
then exit;
FLastChangeboundRect:=Rect(ALeft,ATop,AWidth,AHeight);
and not just changing
FLastChangeboundRect:=Rect(ALeft,ATop,AWidth,AHeight);
to
FLastChangeboundRect:=Bounds(ALeft,ATop,AWidth,AHeight);
the first looks cleaner
i also would rename FLastChangeboundRect to FLastChangeRect
but it's just a suggestion
It should store the rect of the last ChangeBounds call, so maybe FLastChangeBounds is even better.
Mattias
