Qt: Fixed LineTo() extra point drawing.

git-svn-id: trunk@12397 -
This commit is contained in:
zeljko 2007-10-09 20:57:59 +00:00
parent e07b98989f
commit 3de9cce666

View File

@ -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;