mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 10:20:48 +00:00
Add smooth scroll to ui::TextBox
This commit is contained in:
parent
d5d71257fe
commit
5828df1383
@ -129,9 +129,13 @@ bool TextBox::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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user