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:
Charles Dang 2024-09-30 02:32:15 -04:00
parent d4e7f5bc43
commit 07df161c96

View file

@ -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