fix not being able to select / see all elements in menus with tons of elements

This commit is contained in:
jacob1 2013-10-18 16:36:37 -04:00
parent ba43e4d238
commit fd6da26b73
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -384,7 +384,7 @@ void PreviewView::OnMouseWheel(int x, int y, int d)
void PreviewView::OnMouseUp(int x, int y, unsigned int button)
{
//if mouse is on the scrollwheel or farther right, and you are at the top of bottom of a page, change pages
//if mouse is on the scrollbar or farther right, and you are at the top of bottom of a page, change pages
if (x > Position.X+commentsPanel->Position.X+commentsPanel->Size.X-6)
{
if (commentsPanel->GetScrollLimit() == 1)