Permalink
Browse files

also support mouse wheel in scroll portals

  • Loading branch information...
1 parent 8576c58 commit 2119acb709163ed19d2ee9de347075977e3b4a20 @robn robn committed Feb 3, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/GuiVScrollPortal.cpp
View
@@ -58,6 +58,13 @@ float VScrollPortal::GetScrollPixels()
bool VScrollPortal::OnMouseDown(MouseButtonEvent *e)
{
+ if (e->button == 4 || e->button == 5) {
+ float change = e->button == 4 ? -0.1 : 0.1;
+ float pos = vscrollAdjust.GetValue();
+ vscrollAdjust.SetValue(CLAMP(pos+change, 0.0, 1.0));
+ return false;
+ }
+
e->y += GetScrollPixels();
return Container::OnMouseDown(e);
}

0 comments on commit 2119acb

Please sign in to comment.