Fix show_scrollbars

This commit is contained in:
Alexandre Bury 2019-09-19 22:45:54 -07:00
parent 86c800554b
commit cfcdfa7e9e

View File

@ -101,6 +101,11 @@ impl Core {
printer: &Printer<'a, 'b>, printer: &Printer<'a, 'b>,
) -> Printer<'a, 'b> { ) -> Printer<'a, 'b> {
// Draw scrollbar? // Draw scrollbar?
let size = self.available_size();
// Draw the scrollbars
if self.get_show_scrollbars() {
let scrolling = self.is_scrolling(); let scrolling = self.is_scrolling();
let lengths = self.scrollbar_thumb_lengths(); let lengths = self.scrollbar_thumb_lengths();
@ -114,10 +119,8 @@ impl Core {
ColorStyle::highlight_inactive() ColorStyle::highlight_inactive()
}; };
let size = self.available_size(); XY::zip5(lengths, offsets, size, line_c, Orientation::pair())
.run_if(
// Draw the scrollbars
XY::zip5(lengths, offsets, size, line_c, Orientation::pair()).run_if(
scrolling, scrolling,
|(length, offset, size, c, orientation)| { |(length, offset, size, c, orientation)| {
let start = printer let start = printer
@ -152,6 +155,7 @@ impl Core {
if scrolling.both() { if scrolling.both() {
printer.print(printer.size.saturating_sub((1, 1)), ""); printer.print(printer.size.saturating_sub((1, 1)), "");
} }
}
// Draw content // Draw content
printer printer