summaryrefslogtreecommitdiff
path: root/src/gui/minimap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r--src/gui/minimap.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 8339e478..bb51d64a 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -84,6 +84,18 @@ void Minimap::draw(gcn::Graphics *graphics)
{
mapOriginX += ((a.width) / 2) - (player_node->mX * mProportion);
mapOriginY += ((a.height) / 2) - (player_node->mY * mProportion);
+
+ const int minOriginX = a.x + a.width - mMapImage->getWidth();
+ const int minOriginY = a.y + a.height - mMapImage->getHeight();
+
+ if (mapOriginX < minOriginX)
+ mapOriginX = minOriginX;
+ if (mapOriginY < minOriginY)
+ mapOriginY = minOriginY;
+ if (mapOriginX > a.x)
+ mapOriginX = a.x;
+ if (mapOriginY > a.y)
+ mapOriginY = a.y;
}
static_cast<Graphics*>(graphics)->