summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-12-16 21:38:33 +0100
committerLibravatar GitHub <noreply@github.com>2019-12-16 21:38:33 +0100
commit3702b109977a249247a0f1be40e57bec2cbaa4e3 (patch)
tree9919f2ee30ab29c83a2455f838313ab5bfb2f146 /wgpu/src/renderer.rs
parentc1b9f6652517dcbf5ffd83b5db4a624f9a5b0da4 (diff)
parent514ccf8a72d660d77f26e085b545e5104389c138 (diff)
downloadiced-3702b109977a249247a0f1be40e57bec2cbaa4e3.tar.gz
iced-3702b109977a249247a0f1be40e57bec2cbaa4e3.tar.bz2
iced-3702b109977a249247a0f1be40e57bec2cbaa4e3.zip
Merge pull request #111 from Maldela/svg
Svg and icon support
Diffstat (limited to 'wgpu/src/renderer.rs')
-rw-r--r--wgpu/src/renderer.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs
index fa52bd96..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],
});
@@ -342,6 +349,7 @@ impl Renderer {
translated_and_scaled,
bounds,
target,
+ dpi,
);
}