Skip to content

Commit

Permalink
fix: ceil the width and height for damage when converting to u32
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Dec 4, 2023
1 parent 38d819e commit 9f38615
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions examples/sctk_todos/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,16 @@ impl Application for Todos {
.spacing(20)
.max_width(800);

scrollable(
container(content)
column!(
button("test")
.width(Length::Fill)
.padding(40)
.center_x(),
.on_press(Message::Ignore),
scrollable(
container(content)
.width(Length::Fill)
.padding(40)
.center_x(),
)
)
.into()
}
Expand Down
4 changes: 2 additions & 2 deletions tiny_skia/src/window/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ pub fn present<T: AsRef<str>>(
Some(softbuffer::Rect {
x: r.x as u32,
y: r.y as u32,
width: NonZeroU32::new(r.width as u32)?,
height: NonZeroU32::new(r.height as u32)?,
width: NonZeroU32::new(r.width.ceil() as u32)?,
height: NonZeroU32::new(r.height.ceil() as u32)?,
})
})
.collect::<Vec<_>>();
Expand Down

0 comments on commit 9f38615

Please sign in to comment.