You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-22 22:17:48 +02:00
Fixed touch events in FMX demos with high DPI screens
This commit is contained in:
@ -1048,8 +1048,9 @@ begin
|
||||
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
||||
|
||||
TempPoint := FMXBufferPanel1.ScreenToClient(TempPenInfo.pointerInfo.ptPixelLocation);
|
||||
TempTouchEvent.x := DeviceToLogical(TempPoint.x, GlobalCEFApp.DeviceScaleFactor);
|
||||
TempTouchEvent.y := DeviceToLogical(TempPoint.y, GlobalCEFApp.DeviceScaleFactor);
|
||||
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
|
||||
TempTouchEvent.x := TempPoint.x;
|
||||
TempTouchEvent.y := TempPoint.y;
|
||||
|
||||
FMXChromium1.SendTouchEvent(@TempTouchEvent);
|
||||
end;
|
||||
@ -1095,8 +1096,9 @@ begin
|
||||
TempTouchEvent.type_ := CEF_TET_CANCELLED;
|
||||
|
||||
TempPoint := FMXBufferPanel1.ScreenToClient(TempTouchInfo.pointerInfo.ptPixelLocation);
|
||||
TempTouchEvent.x := DeviceToLogical(TempPoint.x, GlobalCEFApp.DeviceScaleFactor);
|
||||
TempTouchEvent.y := DeviceToLogical(TempPoint.y, GlobalCEFApp.DeviceScaleFactor);
|
||||
// TFMXBufferPanel.ScreenToClient applies the scale factor. No need to call DeviceToLogical to set TempTouchEvent.
|
||||
TempTouchEvent.x := TempPoint.x;
|
||||
TempTouchEvent.y := TempPoint.y;
|
||||
|
||||
FMXChromium1.SendTouchEvent(@TempTouchEvent);
|
||||
end;
|
||||
|
Reference in New Issue
Block a user