summaryrefslogtreecommitdiff
path: root/src/gui/game/GameView.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-10-18 20:36:37 (GMT)
committer jacob1 <jfu614@gmail.com>2013-10-18 20:36:37 (GMT)
commitfd6da26b73ad2d4e3dd3b7e87dbcb9744305aa3e (patch)
treeb69e52a24ef981d41570dad98d3ab241a5af8be7 /src/gui/game/GameView.cpp
parentba43e4d238ab60255bde40afd3eb1430fb18ea08 (diff)
downloadpowder-fd6da26b73ad2d4e3dd3b7e87dbcb9744305aa3e.zip
powder-fd6da26b73ad2d4e3dd3b7e87dbcb9744305aa3e.tar.gz
fix not being able to select / see all elements in menus with tons of elements
Diffstat (limited to 'src/gui/game/GameView.cpp')
-rw-r--r--src/gui/game/GameView.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp
index 12904f1..41dc248 100644
--- a/src/gui/game/GameView.cpp
+++ b/src/gui/game/GameView.cpp
@@ -1633,12 +1633,12 @@ void GameView::DoMouseMove(int x, int y, int dx, int dy)
int mouseX = x;
if(mouseX > XRES)
mouseX = XRES;
- if (mouseX < 15)
- mouseX = 15;
+ //if (mouseX < 15) //makes scrolling a little nicer at edges but apparently if you put hundreds of elements in a menu it makes the end not show ...
+ // mouseX = 15;
scrollBar->Position.X = (int)(((float)mouseX/((float)XRES))*(float)(XRES-scrollSize));
- float overflow = totalWidth-(XRES-BARSIZE), mouseLocation = float(XRES)/float(mouseX-(XRES));
+ float overflow = totalWidth-(XRES-BARSIZE), mouseLocation = float(XRES-3)/float(mouseX-(XRES-2)); //mouseLocation adjusted slightly in case you have 200 elements in one menu
setToolButtonOffset(overflow/mouseLocation);
//Ensure that mouseLeave events are make their way to the buttons should they move from underneath the mouse pointer