summaryrefslogtreecommitdiff
path: root/src/game/GameView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GameView.cpp')
-rw-r--r--src/game/GameView.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index bfd8236..179afb9 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -497,7 +497,13 @@ void GameView::setToolButtonOffset(int offset)
for(vector<ToolButton*>::iterator iter = toolButtons.begin(), end = toolButtons.end(); iter!=end; ++iter)
{
- (*iter)->Position.X -= offset;
+ ToolButton * button = *iter;
+ button->Position.X -= offset;
+ if(button->Position.X <= 0 || (button->Position.X+button->Size.X) > XRES-2) {
+ button->Visible = false;
+ } else {
+ button->Visible = true;
+ }
}
}
@@ -826,12 +832,12 @@ void GameView::DoMouseMove(int x, int y, int dx, int dy)
if(toolButtons.size())
{
int totalWidth = (toolButtons[0]->Size.X+1)*toolButtons.size();
- if(totalWidth > XRES-10)
+ if(totalWidth > XRES-15)
{
int mouseX = x;
if(mouseX > XRES)
mouseX = XRES;
- float overflow = totalWidth-(XRES-10), mouseLocation = float(XRES)/float(mouseX-(XRES));
+ float overflow = totalWidth-(XRES-15), mouseLocation = float(XRES)/float(mouseX-(XRES));
setToolButtonOffset(overflow/mouseLocation);
//Ensure that mouseLeave events are make their way to the buttons should they move from underneith the mouse pointer