fix bottom scroll artifacts, slow scroll for readability

This commit is contained in:
2026-06-19 13:35:46 +02:00
parent 838e29702a
commit 1c854d127f
2 changed files with 6 additions and 6 deletions

View File

@@ -104,11 +104,11 @@ impl RenderEngine {
for cmd in &mut cmds { for cmd in &mut cmds {
cmd.y = cmd.y.saturating_sub(scroll_offset); cmd.y = cmd.y.saturating_sub(scroll_offset);
} }
cmds.retain(|cmd| {
let line_h = self.metrics.char_height(cmd.font);
cmd.y >= bounds.y && cmd.y + line_h <= bounds.y + bounds.height
});
} }
cmds.retain(|cmd| {
let line_h = self.metrics.char_height(cmd.font);
cmd.y >= bounds.y && cmd.y + line_h <= bounds.y + bounds.height
});
cmds cmds
} }

View File

@@ -1,7 +1,7 @@
use std::time::Duration; use std::time::Duration;
const PAUSE_DURATION: Duration = Duration::from_secs(2); const PAUSE_DURATION: Duration = Duration::from_secs(3);
const SCROLL_SPEED_PX_PER_SEC: f32 = 30.0; const SCROLL_SPEED_PX_PER_SEC: f32 = 15.0;
#[derive(Debug)] #[derive(Debug)]
pub struct ScrollState { pub struct ScrollState {