ui: harden bounds check in inspect_bounds macro
parent
565b11634a
commit
3a86a7ca16
|
@ -757,7 +757,7 @@ macro_rules! inspect_bounds {
|
||||||
($grid:ident, $area:ident, $x: ident, $y: ident, $line_break:ident) => {
|
($grid:ident, $area:ident, $x: ident, $y: ident, $line_break:ident) => {
|
||||||
let bounds = $grid.size();
|
let bounds = $grid.size();
|
||||||
let (upper_left, bottom_right) = $area;
|
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);
|
$x = get_x(upper_left);
|
||||||
$y += 1;
|
$y += 1;
|
||||||
if $y > (get_y(bottom_right)) || $y > get_y(bounds) {
|
if $y > (get_y(bottom_right)) || $y > get_y(bounds) {
|
||||||
|
|
Loading…
Reference in New Issue