apply changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
This commit is contained in:
Nyx 2024-10-02 03:59:43 -04:00 committed by GitHub
parent 743b22b3c4
commit 5cac3086fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -188,7 +188,7 @@ impl FloatingText {
} }
fn scroll_down(&mut self) { fn scroll_down(&mut self) {
let visible_lines = self.get_visible_lines(); let visible_lines = self.frame_height.saturating_sub(2);
if self.v_scroll + visible_lines < self.src.len() { if self.v_scroll + visible_lines < self.src.len() {
self.v_scroll += 1; self.v_scroll += 1;
} }
@ -211,10 +211,6 @@ impl FloatingText {
self.h_scroll += 1; self.h_scroll += 1;
} }
} }
fn get_visible_lines(&self) -> usize {
self.frame_height.saturating_sub(2)
}
} }
impl FloatContent for FloatingText { impl FloatContent for FloatingText {