summaryrefslogtreecommitdiff
path: root/src/game/GameView.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-08 21:04:14 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-08 21:04:14 (GMT)
commit0ee1e1875d00876b946f358308f39dc33ef96ea4 (patch)
treec0ea64b19f03541cb71b96ed3acc4c6c3e2e1834 /src/game/GameView.cpp
parent1dadb11fc218786a36cc46714a0478e229ca44a9 (diff)
downloadpowder-0ee1e1875d00876b946f358308f39dc33ef96ea4.zip
powder-0ee1e1875d00876b946f358308f39dc33ef96ea4.tar.gz
Load save data when showing the save preview
Diffstat (limited to 'src/game/GameView.cpp')
-rw-r--r--src/game/GameView.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index adc5883..89d9fac 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -898,17 +898,19 @@ void GameView::OnDraw()
int thumbX = selectPoint2.X - (tempThumb->Size.X/2);
int thumbY = selectPoint2.Y - (tempThumb->Size.Y/2);
- if(thumbX<0)
- thumbX = 0;
- if(thumbX+(tempThumb->Size.X)>=XRES)
- thumbX = XRES-tempThumb->Size.X;
+ ui::Point thumbPos = c->NormaliseBlockCoord(ui::Point(thumbX, thumbY));
- if(thumbY<0)
- thumbY = 0;
- if(thumbY+(tempThumb->Size.Y)>=YRES)
- thumbY = YRES-tempThumb->Size.Y;
+ if(thumbPos.X<0)
+ thumbPos.X = 0;
+ if(thumbPos.X+(tempThumb->Size.X)>=XRES)
+ thumbPos.X = XRES-tempThumb->Size.X;
+
+ if(thumbPos.Y<0)
+ thumbPos.Y = 0;
+ if(thumbPos.Y+(tempThumb->Size.Y)>=YRES)
+ thumbPos.Y = YRES-tempThumb->Size.Y;
- g->draw_image(tempThumb->Data, thumbX, thumbY, tempThumb->Size.X, tempThumb->Size.Y, 128);
+ g->draw_image(tempThumb->Data, thumbPos.X, thumbPos.Y, tempThumb->Size.X, tempThumb->Size.Y, 128);
}
}
else