Display: don't return const map_locations
This commit is contained in:
parent
c5891ef7fe
commit
01efec92fa
2 changed files with 4 additions and 4 deletions
|
@ -539,7 +539,7 @@ bool display::outside_area(const SDL_Rect& area, const int x, const int y)
|
|||
}
|
||||
|
||||
// This function uses the screen as reference
|
||||
const map_location display::hex_clicked_on(int xclick, int yclick) const
|
||||
map_location display::hex_clicked_on(int xclick, int yclick) const
|
||||
{
|
||||
rect r = map_area();
|
||||
if(!r.contains(xclick, yclick)) {
|
||||
|
@ -553,7 +553,7 @@ const map_location display::hex_clicked_on(int xclick, int yclick) const
|
|||
}
|
||||
|
||||
// This function uses the rect of map_area as reference
|
||||
const map_location display::pixel_position_to_hex(int x, int y) const
|
||||
map_location display::pixel_position_to_hex(int x, int y) const
|
||||
{
|
||||
// adjust for the border
|
||||
x -= static_cast<int>(theme_.border().size * hex_width());
|
||||
|
|
|
@ -290,14 +290,14 @@ public:
|
|||
* location of the hex that this pixel corresponds to.
|
||||
* Returns an invalid location if the mouse isn't over any valid location.
|
||||
*/
|
||||
const map_location hex_clicked_on(int x, int y) const;
|
||||
map_location hex_clicked_on(int x, int y) const;
|
||||
|
||||
/**
|
||||
* given x,y co-ordinates of a pixel on the map, will return the
|
||||
* location of the hex that this pixel corresponds to.
|
||||
* Returns an invalid location if the mouse isn't over any valid location.
|
||||
*/
|
||||
const map_location pixel_position_to_hex(int x, int y) const;
|
||||
map_location pixel_position_to_hex(int x, int y) const;
|
||||
|
||||
/**
|
||||
* given x,y co-ordinates of the mouse, will return the location of the
|
||||
|
|
Loading…
Add table
Reference in a new issue