diff --git a/cursive-core/src/views/text_view.rs b/cursive-core/src/views/text_view.rs index c2e58d2..0e72b53 100644 --- a/cursive-core/src/views/text_view.rs +++ b/cursive-core/src/views/text_view.rs @@ -396,8 +396,13 @@ impl View for TextView { let content = self.content.content.lock().unwrap(); + let miny = printer.content_offset.y; + let maxy = printer.output_size.y + printer.content_offset.y; printer.with_style(self.style, |printer| { for (y, row) in self.rows.iter().enumerate() { + if y < miny || y >= maxy { + continue; + } let l = row.width; let mut x = self.align.h.get_offset(l, printer.size.x);