Don't panic when allocating tiny_skia pixmap
This commit is contained in:
parent
031472dc5a
commit
4b55b578b2
1 changed files with 1 additions and 1 deletions
|
@ -143,7 +143,7 @@ impl SpriteCache {
|
||||||
}) {
|
}) {
|
||||||
Entry::Occupied(entry) => Some(entry.get().clone()),
|
Entry::Occupied(entry) => Some(entry.get().clone()),
|
||||||
Entry::Vacant(entry) => {
|
Entry::Vacant(entry) => {
|
||||||
let mut pixmap = tiny_skia::Pixmap::new(size.x() as u32, size.y() as u32).unwrap();
|
let mut pixmap = tiny_skia::Pixmap::new(size.x() as u32, size.y() as u32)?;
|
||||||
resvg::render(&svg, usvg::FitTo::Width(size.x() as u32), pixmap.as_mut());
|
resvg::render(&svg, usvg::FitTo::Width(size.x() as u32), pixmap.as_mut());
|
||||||
let mask = pixmap
|
let mask = pixmap
|
||||||
.pixels()
|
.pixels()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue