Browse Source

MailView, StatusBar: Fix area bound check

jmap-eventsource
Manos Pitsidianakis 1 year ago
parent
commit
d076ff573f
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 4
      src/components/mail/view.rs
  2. 4
      src/components/utilities.rs

4
src/components/mail/view.rs

@ -1070,6 +1070,7 @@ impl Component for MailView {
($($string:expr)+) => {
$({
if sticky || skip_header_ctr == 0 {
if y <= get_y(bottom_right) {
let (_x, _y) = write_string_to_grid(
&$string,
grid,
@ -1079,8 +1080,9 @@ impl Component for MailView {
(set_y(upper_left, y), bottom_right),
Some(get_x(upper_left)),
);
clear_area(grid, ((_x, _y), (get_x(bottom_right), _y)), headers);
clear_area(grid, ((std::cmp::min(_x, get_x(bottom_right)), _y), (get_x(bottom_right), _y)), headers);
y = _y + 1;
}
} else {
skip_header_ctr -= 1;
}

4
src/components/utilities.rs

@ -312,7 +312,7 @@ impl Component for StatusBar {
get_x(upper_left),
std::cmp::min(
get_y(bottom_right) - height - hist_height + 1,
get_y(bottom_right),
get_y(pos_dec(bottom_right, (0, height))),
),
),
pos_dec(bottom_right, (0, height)),
@ -339,7 +339,7 @@ impl Component for StatusBar {
get_x(upper_left),
std::cmp::min(
get_y(bottom_right) - height - hist_height + 1,
get_y(bottom_right),
get_y(pos_dec(bottom_right, (0, height))),
),
),
pos_dec(bottom_right, (0, height)),

Loading…
Cancel
Save