fix bottom scroll artifacts, slow scroll for readability
This commit is contained in:
@@ -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| {
|
cmds.retain(|cmd| {
|
||||||
let line_h = self.metrics.char_height(cmd.font);
|
let line_h = self.metrics.char_height(cmd.font);
|
||||||
cmd.y >= bounds.y && cmd.y + line_h <= bounds.y + bounds.height
|
cmd.y >= bounds.y && cmd.y + line_h <= bounds.y + bounds.height
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
cmds
|
cmds
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user