MailView, StatusBar: Fix area bound check

jmap-eventsource
Manos Pitsidianakis 2020-11-28 20:06:16 +02:00
parent 6cbb89a8e5
commit d076ff573f
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
2 changed files with 5 additions and 3 deletions

View File

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

View File

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