mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 03:44:16 +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: {
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user