summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-11-28 20:06:16 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-11-28 20:33:14 +0200
commitd076ff573f47fb7538930171ce397e3199ceaeaf (patch)
tree5514b78df883412f744144953b4c4d320ac0fb16
parent6cbb89a8e53e3b038c3730f1e8a61b10c3e977fa (diff)
MailView, StatusBar: Fix area bound check
-rw-r--r--src/components/mail/view.rs4
-rw-r--r--src/components/utilities.rs4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/components/mail/view.rs b/src/components/mail/view.rs
index 64f1988a..5e17af1c 100644
--- a/src/components/mail/view.rs
+++ b/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;
}
diff --git a/src/components/utilities.rs b/src/components/utilities.rs
index b0584ff7..7d869784 100644
--- a/src/components/utilities.rs
+++ b/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)),