Skip to content

Commit

Permalink
Merge pull request #952 from aentity/fix_svg_memory
Browse files Browse the repository at this point in the history
Use ceil on svg dimensions, fix svg memory usage ref #841
  • Loading branch information
hecrj authored Jul 21, 2021
2 parents 8e29709 + 665422e commit 14c1e70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wgpu/src/image/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl Cache {
let id = handle.id();

let (width, height) = (
(scale * width).round() as u32,
(scale * height).round() as u32,
(scale * width).ceil() as u32,
(scale * height).ceil() as u32,
);

// TODO: Optimize!
Expand Down Expand Up @@ -122,6 +122,7 @@ impl Cache {
device,
encoder,
)?;
log::debug!("allocating {} {}x{}", id, width, height);

let _ = self.svg_hits.insert(id);
let _ = self.rasterized_hits.insert((id, width, height));
Expand Down

0 comments on commit 14c1e70

Please sign in to comment.