Display: simplify tile_fully_on_screen
outside_area checks that the point is within the given rect reduced by hex_size(). Since that's the size of a location rect, the adjustment meant that a hex can't protrude outside the map area. This simplifies the logic using rect math instead of point math.
This commit is contained in:
parent
d4e7f5bc43
commit
07df161c96
1 changed files with 1 additions and 2 deletions
|
@ -1918,8 +1918,7 @@ void display::toggle_default_zoom()
|
|||
|
||||
bool display::tile_fully_on_screen(const map_location& loc) const
|
||||
{
|
||||
const auto [x, y] = get_location(loc);
|
||||
return !outside_area(map_area(), x, y);
|
||||
return map_area().contains(get_location_rect(loc));
|
||||
}
|
||||
|
||||
bool display::tile_nearly_on_screen(const map_location& loc) const
|
||||
|
|
Loading…
Add table
Reference in a new issue