diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-06 17:27:10 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-06 17:27:10 +0800 |
| commit | 6315e654ce0be2d2cc148e9ff80f611ac1176348 (patch) | |
| tree | 8232fedd7bbe87d635563e743e22781e20f83376 /src/ui/render/ScrollRenderObject.cpp | |
| parent | 38b1268028d4d631de15ca85826c241e39c82675 (diff) | |
| download | cru-6315e654ce0be2d2cc148e9ff80f611ac1176348.tar.gz cru-6315e654ce0be2d2cc148e9ff80f611ac1176348.tar.bz2 cru-6315e654ce0be2d2cc148e9ff80f611ac1176348.zip | |
Refactor Event.
Diffstat (limited to 'src/ui/render/ScrollRenderObject.cpp')
| -rw-r--r-- | src/ui/render/ScrollRenderObject.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ui/render/ScrollRenderObject.cpp b/src/ui/render/ScrollRenderObject.cpp index b8b6904d..ea93dd21 100644 --- a/src/ui/render/ScrollRenderObject.cpp +++ b/src/ui/render/ScrollRenderObject.cpp @@ -218,7 +218,7 @@ void ScrollRenderObject::InstallMouseWheelHandler(controls::Control* control) { guard_.Clear(); if (control != nullptr) { - guard_ += control->MouseWheelEvent()->Bubble()->PrependShortCircuitHandler( + guard_ += control->MouseWheelEvent()->Bubble()->AddHandler( [this](events::MouseWheelEventArgs& args) { auto delta = args.GetDelta(); @@ -228,24 +228,19 @@ void ScrollRenderObject::InstallMouseWheelHandler(controls::Control* control) { if (VerticalCanScrollDown()) { ApplyScroll( Scroll{Direction::Vertical, ScrollKind::Relative, delta}); - return true; } else if (HorizontalCanScrollDown()) { ApplyScroll( Scroll{Direction::Horizontal, ScrollKind::Relative, delta}); - return true; } } else if (delta < 0) { if (VerticalCanScrollUp()) { ApplyScroll( Scroll{Direction::Vertical, ScrollKind::Relative, delta}); - return true; } else if (HorizontalCanScrollUp()) { ApplyScroll( Scroll{Direction::Horizontal, ScrollKind::Relative, delta}); - return true; } } - return false; }); } } |
