From c0dcd7254a6704f6b1322e69b0a08a25c190078e Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sat, 17 Aug 2019 12:26:32 +0300 Subject: [PATCH] ui: bound check in draw_horz in ThreadView --- ui/src/components/mail/view/thread.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/src/components/mail/view/thread.rs b/ui/src/components/mail/view/thread.rs index 57483825a..a9b7e6f04 100644 --- a/ui/src/components/mail/view/thread.rs +++ b/ui/src/components/mail/view/thread.rs @@ -683,7 +683,11 @@ impl ThreadView { return; } - let mid = get_y(upper_left) + total_rows - bottom_entity_rows; + let mut mid = get_y(upper_left) + total_rows - bottom_entity_rows; + if mid >= get_y(bottom_right) { + mid = get_y(bottom_right) / 2; + } + let mid = mid; /* First draw the thread subject on the first row */ let y = {