fix bottom scroll artifacts, slow scroll for readability
This commit is contained in:
@@ -104,11 +104,11 @@ impl RenderEngine {
|
||||
for cmd in &mut cmds {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
const PAUSE_DURATION: Duration = Duration::from_secs(2);
|
||||
const SCROLL_SPEED_PX_PER_SEC: f32 = 30.0;
|
||||
const PAUSE_DURATION: Duration = Duration::from_secs(3);
|
||||
const SCROLL_SPEED_PX_PER_SEC: f32 = 15.0;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ScrollState {
|
||||
|
||||
Reference in New Issue
Block a user