summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-15 06:19:07 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-15 06:19:07 +0100
commit09707f29fcf7fbd71570a43db214921043427c3f (patch)
treeb3e045a64e81f58910c976b0478e6f7f91780ad0 /wgpu/src/renderer.rs
parent27717bc70c3947f553a8b75da9789fe967994a31 (diff)
downloadiced-09707f29fcf7fbd71570a43db214921043427c3f.tar.gz
iced-09707f29fcf7fbd71570a43db214921043427c3f.tar.bz2
iced-09707f29fcf7fbd71570a43db214921043427c3f.zip
Rerasterize SVGs when resized and refactor a bit
Diffstat (limited to 'wgpu/src/renderer.rs')
-rw-r--r--wgpu/src/renderer.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs
index d1d4de14..365ef1ef 100644
--- a/wgpu/src/renderer.rs
+++ b/wgpu/src/renderer.rs
@@ -1,4 +1,4 @@
-use crate::{quad, text, Image, Primitive, Quad, Transformation};
+use crate::{image, quad, text, Image, Primitive, Quad, Transformation};
use iced_native::{
renderer::{Debugger, Windowed},
Background, Color, Layout, MouseCursor, Point, Rectangle, Vector, Widget,
@@ -232,7 +232,14 @@ impl Renderer {
}
Primitive::Image { handle, bounds } => {
layer.images.push(Image {
- handle: handle.clone(),
+ handle: image::Handle::Raster(handle.clone()),
+ position: [bounds.x, bounds.y],
+ scale: [bounds.width, bounds.height],
+ });
+ }
+ Primitive::Svg { handle, bounds } => {
+ layer.images.push(Image {
+ handle: image::Handle::Vector(handle.clone()),
position: [bounds.x, bounds.y],
scale: [bounds.width, bounds.height],
});