mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-21 16:20:53 +00:00
Support scrolling the debugger source code viewport w/the mouse wheel
This commit is contained in:
parent
534163ae5f
commit
91e8e5cd46
@ -170,6 +170,25 @@ public:
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) override {
|
||||
switch (msg->type()) {
|
||||
|
||||
case kMouseWheelMessage: {
|
||||
View* view = View::getView(this);
|
||||
if (view) {
|
||||
auto mouseMsg = static_cast<MouseMessage*>(msg);
|
||||
gfx::Point scroll = view->viewScroll();
|
||||
|
||||
if (mouseMsg->preciseWheel())
|
||||
scroll += mouseMsg->wheelDelta();
|
||||
else
|
||||
scroll += mouseMsg->wheelDelta() * textHeight()*3;
|
||||
|
||||
view->setViewScroll(scroll);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return Widget::onProcessMessage(msg);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user