mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +00:00
Add smooth scroll w/macOS trackpad to more widgets
This commit is contained in:
parent
f985e6c6c0
commit
b2a25954d4
@ -279,7 +279,12 @@ bool FileList::onProcessMessage(Message* msg)
|
|||||||
View* view = View::getView(this);
|
View* view = View::getView(this);
|
||||||
if (view) {
|
if (view) {
|
||||||
gfx::Point scroll = view->viewScroll();
|
gfx::Point scroll = view->viewScroll();
|
||||||
scroll += static_cast<MouseMessage*>(msg)->wheelDelta() * 3*(textHeight()+4*guiscale());
|
|
||||||
|
if (static_cast<MouseMessage*>(msg)->preciseWheel())
|
||||||
|
scroll += static_cast<MouseMessage*>(msg)->wheelDelta();
|
||||||
|
else
|
||||||
|
scroll += static_cast<MouseMessage*>(msg)->wheelDelta() * 3*(textHeight()+4*guiscale());
|
||||||
|
|
||||||
view->setViewScroll(scroll);
|
view->setViewScroll(scroll);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -382,13 +382,19 @@ bool PaletteView::onProcessMessage(Message* msg)
|
|||||||
|
|
||||||
gfx::Point delta = static_cast<MouseMessage*>(msg)->wheelDelta();
|
gfx::Point delta = static_cast<MouseMessage*>(msg)->wheelDelta();
|
||||||
|
|
||||||
if (msg->onlyCtrlPressed()) {
|
if (msg->onlyCtrlPressed() ||
|
||||||
|
msg->onlyCmdPressed()) {
|
||||||
int z = delta.x - delta.y;
|
int z = delta.x - delta.y;
|
||||||
setBoxSize(m_boxsize + z);
|
setBoxSize(m_boxsize + z);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gfx::Point scroll = view->viewScroll();
|
gfx::Point scroll = view->viewScroll();
|
||||||
scroll += delta * 3 * m_boxsize;
|
|
||||||
|
if (static_cast<MouseMessage*>(msg)->preciseWheel())
|
||||||
|
scroll += delta;
|
||||||
|
else
|
||||||
|
scroll += delta * 3 * m_boxsize;
|
||||||
|
|
||||||
view->setViewScroll(scroll);
|
view->setViewScroll(scroll);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user