mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-01-03 10:15:38 +02:00
Fixed touch events in FMX demos with high DPI screens
This commit is contained in:
parent
feaeb772cb
commit
78adeecde2
@ -2,7 +2,7 @@ object FMXExternalPumpBrowserFrm: TFMXExternalPumpBrowserFrm
|
|||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Caption = 'Initializing browser. Please wait...'
|
Caption = 'Initializing browser. Please wait...'
|
||||||
ClientHeight = 534
|
ClientHeight = 633
|
||||||
ClientWidth = 800
|
ClientWidth = 800
|
||||||
Position = ScreenCenter
|
Position = ScreenCenter
|
||||||
FormFactor.Width = 320
|
FormFactor.Width = 320
|
||||||
@ -90,7 +90,7 @@ object FMXExternalPumpBrowserFrm: TFMXExternalPumpBrowserFrm
|
|||||||
Color = claTomato
|
Color = claTomato
|
||||||
CanFocus = True
|
CanFocus = True
|
||||||
Size.Width = 800.000000000000000000
|
Size.Width = 800.000000000000000000
|
||||||
Size.Height = 501.000000000000000000
|
Size.Height = 600.000000000000000000
|
||||||
Size.PlatformDefault = False
|
Size.PlatformDefault = False
|
||||||
OnEnter = Panel1Enter
|
OnEnter = Panel1Enter
|
||||||
OnExit = Panel1Exit
|
OnExit = Panel1Exit
|
||||||
|
@ -1051,8 +1051,9 @@ begin
|
|||||||
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
||||||
|
|
||||||
TempPoint := Panel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation);
|
TempPoint := Panel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation);
|
||||||
TempTouchEvent.x := DeviceToLogical(TempPoint.x, GlobalCEFApp.DeviceScaleFactor);
|
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
|
||||||
TempTouchEvent.y := DeviceToLogical(TempPoint.y, GlobalCEFApp.DeviceScaleFactor);
|
TempTouchEvent.x := TempPoint.x;
|
||||||
|
TempTouchEvent.y := TempPoint.y;
|
||||||
|
|
||||||
chrmosr.SendTouchEvent(@TempTouchEvent);
|
chrmosr.SendTouchEvent(@TempTouchEvent);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -1101,8 +1102,9 @@ begin
|
|||||||
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
||||||
|
|
||||||
TempPoint := Panel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation);
|
TempPoint := Panel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation);
|
||||||
TempTouchEvent.x := DeviceToLogical(TempPoint.x, GlobalCEFApp.DeviceScaleFactor);
|
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
|
||||||
TempTouchEvent.y := DeviceToLogical(TempPoint.y, GlobalCEFApp.DeviceScaleFactor);
|
TempTouchEvent.x := TempPoint.x;
|
||||||
|
TempTouchEvent.y := TempPoint.y;
|
||||||
|
|
||||||
chrmosr.SendTouchEvent(@TempTouchEvent);
|
chrmosr.SendTouchEvent(@TempTouchEvent);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -1048,8 +1048,9 @@ begin
|
|||||||
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
||||||
|
|
||||||
TempPoint := FMXBufferPanel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation);
|
TempPoint := FMXBufferPanel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation);
|
||||||
TempTouchEvent.x := DeviceToLogical(TempPoint.x, GlobalCEFApp.DeviceScaleFactor);
|
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
|
||||||
TempTouchEvent.y := DeviceToLogical(TempPoint.y, GlobalCEFApp.DeviceScaleFactor);
|
TempTouchEvent.x := TempPoint.x;
|
||||||
|
TempTouchEvent.y := TempPoint.y;
|
||||||
|
|
||||||
FMXChromium1.SendTouchEvent(@TempTouchEvent);
|
FMXChromium1.SendTouchEvent(@TempTouchEvent);
|
||||||
end;
|
end;
|
||||||
@ -1095,8 +1096,9 @@ begin
|
|||||||
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
||||||
|
|
||||||
TempPoint := FMXBufferPanel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation);
|
TempPoint := FMXBufferPanel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation);
|
||||||
TempTouchEvent.x := DeviceToLogical(TempPoint.x, GlobalCEFApp.DeviceScaleFactor);
|
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
|
||||||
TempTouchEvent.y := DeviceToLogical(TempPoint.y, GlobalCEFApp.DeviceScaleFactor);
|
TempTouchEvent.x := TempPoint.x;
|
||||||
|
TempTouchEvent.y := TempPoint.y;
|
||||||
|
|
||||||
FMXChromium1.SendTouchEvent(@TempTouchEvent);
|
FMXChromium1.SendTouchEvent(@TempTouchEvent);
|
||||||
end;
|
end;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 102,
|
"InternalVersion" : 103,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "80.0.4.0"
|
"Version" : "80.0.4.0"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user