fpspreadsheet: Improved painting of WorksheetGrid's FocusRect (priority to stay inside the cell).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5854 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2017-05-13 12:41:03 +00:00
parent dbe8c84cd7
commit 29481d9382

View File

@ -2850,7 +2850,7 @@ var
R: TRect;
cell: PCell;
r1,c1,r2,c2: Cardinal;
//delta: Integer;
delta: Integer;
savedPenMode: TPenMode;
begin
if Worksheet = nil then
@ -2865,9 +2865,15 @@ begin
end else
R := CellRect(Selection.Left, Selection.Top, Selection.Right, Selection.Bottom);
// Draw focus rect inside
delta := Max(FSelPen.Width div 2, 0);
inc(R.Top, delta);
if IsRightToLeft then dec(R.Right, delta) else inc(R.Left, delta);
{
dec(R.Top);
if IsRightToLeft then inc(R.Right) else dec(R.Left);
}
// Cosmetics at the edges of the grid to avoid spurious rests
{
delta := Max(FSelPen.Width div 2, 0);