Rerasterize SVGs when resized and refactor a bit

This commit is contained in:
Héctor Ramón Jiménez 2019-12-15 06:19:07 +01:00
parent 27717bc70c
commit 09707f29fc
8 changed files with 543 additions and 273 deletions

View file

@ -1,6 +1,6 @@
use iced_native::{
image, Background, Color, Font, HorizontalAlignment, Rectangle, Vector,
VerticalAlignment,
image, svg, Background, Color, Font, HorizontalAlignment, Rectangle,
Vector, VerticalAlignment,
};
/// A rendering primitive.
@ -46,6 +46,14 @@ pub enum Primitive {
/// The bounds of the image
bounds: Rectangle,
},
/// An SVG primitive
Svg {
/// The path of the SVG file
handle: svg::Handle,
/// The bounds of the viewport
bounds: Rectangle,
},
/// A clip primitive
Clip {
/// The bounds of the clip