Merge pull request #134 from hecrj/fix/invisible-svg-panic

Avoid rasterizing SVG when a dimension is 0
This commit is contained in:
Héctor Ramón 2019-12-21 23:53:01 +01:00 committed by GitHub
commit 8fcf7ccaa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,6 +91,10 @@ impl Cache {
match self.load(handle) {
Svg::Loaded { tree } => {
if width == 0 || height == 0 {
return None;
}
let extent = wgpu::Extent3d {
width,
height,