LCL-fpgui: Fix Canvas.BeginDraw() call in DeviceContext class + extra check added. Issue #35478, patch from Graeme.

git-svn-id: trunk@61127 -
This commit is contained in:
juha 2019-05-03 19:45:33 +00:00
parent a1e1ff2512
commit 627ed33840

View File

@ -317,15 +317,20 @@ end;
constructor TFPGUIDeviceContext.Create(AFPGUIPrivate: TFPGUIPrivateWidget);
begin
if Assigned(AFPGUIPrivate) then begin
// The Widget.Visible check is just for extra precaution.
if Assigned(AFPGUIPrivate) and AFPGUIPrivate.Widget.Visible then
begin
fpgCanvas := AFPGUIPrivate.Widget.Canvas;
fpgCanvas.BeginDraw(false);
fpgCanvas.BeginDraw;
FPrivateWidget:=AFPGUIPrivate;
FPrivateWidget.DC:=HDC(Self);
end else begin
end
else
begin
fpgCanvas := nil;
FPrivateWidget := nil;
end;
with FOrg do begin
X:=0;
Y:=0;