Author: mordante
Date: Sat May 26 15:10:55 2007
New Revision: 17867

URL: http://svn.gna.org/viewcvs/wesnoth?rev=17867&view=rev
Log:
fixes a small offset problem. It's not really noticable but
will be once the new centering code will be committed.

Modified:
    trunk/src/display.cpp

Modified: trunk/src/display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=17867&r1=17866&r2=17867&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sat May 26 15:10:55 2007
@@ -369,6 +369,14 @@
 
 void display::get_rect_hex_bounds(SDL_Rect rect, gamemap::location &topleft, 
gamemap::location &bottomright) const
 {
+       // change the coordinates of the rect send to be relative 
+       // to the map area instead of the screen area
+       const SDL_Rect& map_rect = map_area();
+       rect.x -= map_rect.x;
+       rect.y -= map_rect.y;
+       rect.w += map_rect.x;
+       rect.h += map_rect.y;
+
        const int tile_width = hex_width();
 
        topleft.x  = (xpos_ + rect.x) / tile_width;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to