Merge pull request #134 from hecrj/fix/invisible-svg-panic
Avoid rasterizing SVG when a dimension is 0
This commit is contained in:
commit
8fcf7ccaa7
1 changed files with 4 additions and 0 deletions
|
|
@ -91,6 +91,10 @@ impl Cache {
|
||||||
|
|
||||||
match self.load(handle) {
|
match self.load(handle) {
|
||||||
Svg::Loaded { tree } => {
|
Svg::Loaded { tree } => {
|
||||||
|
if width == 0 || height == 0 {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
let extent = wgpu::Extent3d {
|
let extent = wgpu::Extent3d {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue