diff options
author | 2020-01-12 02:37:46 +0100 | |
---|---|---|
committer | 2020-02-25 13:26:50 +0100 | |
commit | 8562a4c986ff48d478be794c8c4268047a9a57d7 (patch) | |
tree | b96ea555acf2215e80a62e9bcb6d8241178961bc /wgpu | |
parent | 82e0675c071eee6ee71a989f4c8fb9a9fc18fcfe (diff) | |
download | iced-8562a4c986ff48d478be794c8c4268047a9a57d7.tar.gz iced-8562a4c986ff48d478be794c8c4268047a9a57d7.tar.bz2 iced-8562a4c986ff48d478be794c8c4268047a9a57d7.zip |
Fixed texture bleeding
Diffstat (limited to '')
-rw-r--r-- | wgpu/src/image.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index aaecd492..59257399 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -356,10 +356,10 @@ impl Pipeline { #[cfg(any(feature = "image", feature = "svg"))] for (index, image) in instances.iter().enumerate() { if let Some(rec) = recs.get(&index) { - let x = rec.min.x as f32 / atlas_width; - let y = rec.min.y as f32 / atlas_height; - let w = (rec.size().width - 1) as f32 / atlas_width; - let h = (rec.size().height - 1) as f32 / atlas_height; + let x = (rec.min.x as f32 + 0.5) / atlas_width; + let y = (rec.min.y as f32 + 0.5) / atlas_height; + let w = (rec.size().width as f32 - 0.5) / atlas_width; + let h = (rec.size().height as f32 - 0.5) / atlas_height; let instance_buffer = device .create_buffer_mapped(1, wgpu::BufferUsage::COPY_SRC) |