mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 22:52:47 +02:00
Qt: Fixed LineTo() extra point drawing.
git-svn-id: trunk@12397 -
This commit is contained in:
parent
e07b98989f
commit
3de9cce666
@ -3462,6 +3462,8 @@ end;
|
||||
function TQtWidgetSet.LineTo(DC: HDC; X, Y: Integer): Boolean;
|
||||
var
|
||||
PenPos: TPoint;
|
||||
CX: Integer;
|
||||
CY: Integer;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI LineTo]');
|
||||
@ -3473,9 +3475,18 @@ begin
|
||||
|
||||
TQtDeviceContext(DC).getPenPos(@PenPos);
|
||||
|
||||
TQtDeviceContext(DC).drawLine( PenPos.X, PenPos.Y, X, Y);
|
||||
CX := X;
|
||||
CY := Y;
|
||||
|
||||
MoveToEx(DC, X, Y, nil);
|
||||
if (CX <> PenPos.X) and (CX > 0) and (CX > PenPos.X) then
|
||||
CX := CX - 1;
|
||||
|
||||
if (CY <> PenPos.Y) and (CY > 0) and (CY > PenPos.Y) then
|
||||
CY := CY - 1;
|
||||
|
||||
TQtDeviceContext(DC).drawLine( PenPos.X, PenPos.Y, CX, CY);
|
||||
|
||||
MoveToEx(DC, CX, CY, nil);
|
||||
|
||||
Result := True;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user