Rerasterize SVGs when resized and refactor a bit
This commit is contained in:
parent
27717bc70c
commit
09707f29fc
8 changed files with 543 additions and 273 deletions
|
|
@ -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],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue