[lazarus] New Bug Entered

Micha Nelissen M.Nelissen at student.tue.nl
Sun Nov 23 06:56:11 EST 2003


Mattias Gaertner wrote:

> On Sun,  9 Nov 2003 07:31:17 -0500 (EST)  bugtracker at miraclec.com wrote:
> 
> 
>>Title: IDE: SnapToGrid BugFix
>>
>>Entered by: Claude Rieth
>>
>>To obtain REAL snap to grid and not only modulo gridsize function, the
>>following patch needs to be applied (gives behaviour similar to delphi)
>>
>>controlselection.pp
>>
>>function ...FindNearestSnapRight
>>.
>>.
>>FindNearestGridX(NearestRight);
>>//add the following
>>if NearestRight.Valid then
>>  NearestRight.Nearest:=NearestRight.Nearest+1;
> 
> 
> The snapping seems to work correct. The grid leftmost, topmost pixel is
> painted at 0,0 and the grid snaps to 0,0.
> 
> What does Delphi do?
> 
> 
> Mattias

Left,top snaps to 0,0 too. The width, height do 'snap' to ((mod 
gridsize) + 1). I don't know the reasoning for that, though, I always 
have found it odd, because then you can't place buttons side by side 
easily: they overlap with 1 pixel by default.

Micha.






More information about the Lazarus mailing list