You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-22 22:17:48 +02:00
Fixed incorrect coordinates using the wheel button in OSR demos for Windows (VCL).
This commit is contained in:
@ -263,6 +263,7 @@ procedure TForm1.AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
|
||||
var
|
||||
TempKeyEvent : TCefKeyEvent;
|
||||
TempMouseEvent : TCefMouseEvent;
|
||||
TempPoint : TPoint;
|
||||
begin
|
||||
case Msg.message of
|
||||
WM_SYSCHAR :
|
||||
@ -366,11 +367,18 @@ begin
|
||||
WM_MOUSEWHEEL :
|
||||
if Panel1.Focused then
|
||||
begin
|
||||
TempMouseEvent.x := Msg.lParam and $FFFF;
|
||||
TempMouseEvent.y := Msg.lParam shr 16;
|
||||
GetCursorPos(TempPoint);
|
||||
TempPoint := Panel1.ScreenToclient(TempPoint);
|
||||
TempMouseEvent.x := TempPoint.x;
|
||||
TempMouseEvent.y := TempPoint.y;
|
||||
TempMouseEvent.modifiers := GetCefMouseModifiers(Msg.wParam);
|
||||
|
||||
DeviceToLogical(TempMouseEvent, Panel1.ScreenScale);
|
||||
chrmosr.SendMouseWheelEvent(@TempMouseEvent, 0, smallint(Msg.wParam shr 16));
|
||||
|
||||
if CefIsKeyDown(VK_SHIFT) then
|
||||
chrmosr.SendMouseWheelEvent(@TempMouseEvent, smallint(Msg.wParam shr 16), 0)
|
||||
else
|
||||
chrmosr.SendMouseWheelEvent(@TempMouseEvent, 0, smallint(Msg.wParam shr 16));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user