ui: harden bounds check in inspect_bounds macro

embed
Manos Pitsidianakis 2019-10-20 11:24:02 +03:00
parent 565b11634a
commit 3a86a7ca16
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 1 additions and 1 deletions

View File

@ -757,7 +757,7 @@ macro_rules! inspect_bounds {
($grid:ident, $area:ident, $x: ident, $y: ident, $line_break:ident) => {
let bounds = $grid.size();
let (upper_left, bottom_right) = $area;
if $x == (get_x(bottom_right)) + 1 || $x > get_x(bounds) {
if $x > (get_x(bottom_right)) || $x > get_x(bounds) {
$x = get_x(upper_left);
$y += 1;
if $y > (get_y(bottom_right)) || $y > get_y(bounds) {