mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-18 11:42:47 +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: {
|
case kMouseWheelMessage: {
|
||||||
View* view = View::getView(this);
|
View* view = View::getView(this);
|
||||||
if (view) {
|
if (view) {
|
||||||
|
auto mouseMsg = static_cast<MouseMessage*>(msg);
|
||||||
gfx::Point scroll = view->viewScroll();
|
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);
|
view->setViewScroll(scroll);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user