Skip to content

Commit

Permalink
feat(renderer): skip drawing scrollbar if screen height is greater th…
Browse files Browse the repository at this point in the history
…an reserved height (#313)
  • Loading branch information
kokoISnoTarget authored Apr 13, 2024
1 parent 870fcdb commit af3c26b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ impl Renderer {

fn draw_scrollbar(&mut self) -> anyhow::Result<()> {
let (screen_width, screen_height) = self.screen_size();
if screen_height > self.positioner.reserved_height {
return Ok(());
}
let height = (screen_height / self.positioner.reserved_height) * screen_height;
self.draw_rectangle(
Rect::new(
Expand Down

0 comments on commit af3c26b

Please sign in to comment.