mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-09 19:00:46 +00:00
Only render visible content in TextView
This commit is contained in:
parent
4d49b4c1d1
commit
79bfabbc66
@ -394,8 +394,13 @@ impl View for TextView {
|
|||||||
|
|
||||||
let content = self.content.content.lock().unwrap();
|
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| {
|
printer.with_style(self.style, |printer| {
|
||||||
for (y, row) in self.rows.iter().enumerate() {
|
for (y, row) in self.rows.iter().enumerate() {
|
||||||
|
if y < miny || y >= maxy {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let l = row.width;
|
let l = row.width;
|
||||||
let mut x = self.align.h.get_offset(l, printer.size.x);
|
let mut x = self.align.h.get_offset(l, printer.size.x);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user