mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Support smooth scroll in ListBox
This commit is contained in:
parent
1e5ae5e9cb
commit
64af97131d
@ -199,8 +199,14 @@ bool ListBox::onProcessMessage(Message* msg)
|
||||
case kMouseWheelMessage: {
|
||||
View* view = View::getView(this);
|
||||
if (view) {
|
||||
auto mouseMsg = static_cast<MouseMessage*>(msg);
|
||||
gfx::Point scroll = view->viewScroll();
|
||||
scroll += static_cast<MouseMessage*>(msg)->wheelDelta() * textHeight()*3;
|
||||
|
||||
if (mouseMsg->preciseWheel())
|
||||
scroll += mouseMsg->wheelDelta();
|
||||
else
|
||||
scroll += mouseMsg->wheelDelta() * textHeight()*3;
|
||||
|
||||
view->setViewScroll(scroll);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user