Fix #40505: Merge branch 'lhelp/iphtml'

This commit is contained in:
rich2014 2023-09-13 22:17:04 +08:00
parent a0db481a2d
commit 2caae76ebb
2 changed files with 17 additions and 2 deletions

View File

@ -5502,15 +5502,21 @@ begin
end;
function TIpHtmlInternalPanel.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean;
const
WHEEL_DELTA = 120;
var
i: Integer;
begin
Result:=inherited DoMouseWheel(Shift, WheelDelta, MousePos);
for i := 0 to Mouse.WheelScrollLines-1 do
inherited DoMouseWheel(Shift, WheelDelta, MousePos);
for i := abs(Mouse.WheelScrollLines * WheelDelta div WHEEL_DELTA) downto 0 do
if WheelDelta < 0 then
Perform(LM_VSCROLL, MAKELONG(SB_LINEDOWN, 0), 0)
else
Perform(LM_VSCROLL, MAKELONG(SB_LINEUP, 0), 0);
// should always return true to confirm that
// the MouseWheel Event is handled by TIpHtmlInternalPanel
Result:= true;
end;
procedure TIpHtmlInternalPanel.Paint;
@ -5899,13 +5905,19 @@ end;
procedure TIpHtmlInternalPanel.WMHScroll(var Message: TLMHScroll);
begin
if HScroll.Visible then
begin
HScroll.ScrollMessage(Message);
Message.Result := 1;
end;
end;
procedure TIpHtmlInternalPanel.WMVScroll(var Message: TLMVScroll);
begin
if VScroll.Visible then
begin
VScroll.ScrollMessage(Message);
Message.Result := 1;
end;
end;
procedure TIpHtmlInternalPanel.AsyncHotInvoke(data: ptrint);

View File

@ -1355,8 +1355,11 @@ begin
wheelDelta := round(-event.scrollingDeltaX * 120);
end
else
begin
// Filter out empty events - See bug 28491
Result := true;
Exit;
end;
// Filter scrolls that affect both X and Y towards whatever the last scroll was
FLastWheelWasHorz := (Msg.Msg = LM_MOUSEHWHEEL);