From df36cf0398f4a32f739df16b942724ad42fd7e4f Mon Sep 17 00:00:00 2001 From: ejaszczuk Date: Thu, 29 Oct 2020 16:56:14 +0100 Subject: [PATCH] Fix scrollbar in commit msg --- src/components/commit_details/details.rs | 20 ++++++++++++-------- src/ui/scrollbar.rs | 4 ---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/commit_details/details.rs b/src/components/commit_details/details.rs index 6bcc66a01a..f5b513a3a4 100644 --- a/src/components/commit_details/details.rs +++ b/src/components/commit_details/details.rs @@ -355,14 +355,18 @@ impl DrawableComponent for DetailsComponent { ); if self.focused { - ui::draw_scrollbar( - f, - chunks[1], - &self.theme, - self.get_number_of_lines(width as usize) - .saturating_sub(height as usize), - self.scroll_top.get(), - ) + if self.get_number_of_lines(width as usize) + > height as usize + { + ui::draw_scrollbar( + f, + chunks[1], + &self.theme, + self.get_number_of_lines(width as usize) + .saturating_sub(height as usize), + self.scroll_top.get(), + ) + } } Ok(()) diff --git a/src/ui/scrollbar.rs b/src/ui/scrollbar.rs index 673c3ceadf..c002e4a657 100644 --- a/src/ui/scrollbar.rs +++ b/src/ui/scrollbar.rs @@ -45,10 +45,6 @@ impl Widget for Scrollbar { return; } - if area.height > self.max { - return; - } - for y in area.top()..area.bottom() { buf.set_string(right, y, THICK_VERTICAL, self.style_bar); }