From 15cb66e1f1afbb8fe49e4d06ea66df372dfc62c5 Mon Sep 17 00:00:00 2001 From: salvadordf Date: Mon, 4 Jul 2022 15:41:27 +0200 Subject: [PATCH] Fixed backwards compatibility issue in FMXTabbedBrowser demo --- .../FMXTabbedBrowser/uBrowserFrame.pas | 15 +++++++-------- update_CEF4Delphi.json | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas b/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas index 8f554363..f9255092 100644 --- a/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas +++ b/demos/Delphi_FMX_Windows/FMXTabbedBrowser/uBrowserFrame.pas @@ -93,7 +93,7 @@ type function GetParentForm : TCustomForm; function GetParentTab : TTabItem; - function GetFMXWindowParentRect : TRectF; + function GetFMXWindowParentRect : TRect; procedure CreateFMXWindowParent; public @@ -140,18 +140,17 @@ begin FMXWindowParent := nil; end; -function TBrowserFrame.GetFMXWindowParentRect : TRectF; +function TBrowserFrame.GetFMXWindowParentRect : TRect; var - TempRect : TRectF; TempPoint : TPointF; TempScale : single; begin TempScale := FMXChromium1.ScreenScale; TempPoint := LocalToAbsolute(WindowParentLay.Position.Point); - Result.Left := TempPoint.x; - Result.Top := TempPoint.y; - Result.Right := TempPoint.x + (WindowParentLay.Width * TempScale); - Result.Bottom := TempPoint.y + (WindowParentLay.Height * TempScale); + Result.Left := round(TempPoint.x); + Result.Top := round(TempPoint.y); + Result.Right := round(TempPoint.x + (WindowParentLay.Width * TempScale)); + Result.Bottom := round(TempPoint.y + (WindowParentLay.Height * TempScale)); end; procedure TBrowserFrame.ReloadBtnClick(Sender: TObject); @@ -162,7 +161,7 @@ end; procedure TBrowserFrame.ResizeBrowser; begin if (FMXWindowParent <> nil) then - FMXWindowParent.SetBoundsF(GetFMXWindowParentRect); + FMXWindowParent.SetBounds(GetFMXWindowParentRect); end; procedure TBrowserFrame.ShowBrowser; diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index 64c61951..ab0c72d7 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 411, + "InternalVersion" : 412, "Name" : "cef4delphi_lazarus.lpk", "Version" : "103.0.8.0" }