Mark Primitive as non-exhaustive in iced_graphics
This commit is contained in:
parent
868f79d22e
commit
bbeaf10c04
4 changed files with 9 additions and 3 deletions
|
|
@ -34,7 +34,6 @@ log = "0.4"
|
||||||
raw-window-handle = "0.5"
|
raw-window-handle = "0.5"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
bitflags = "1.2"
|
bitflags = "1.2"
|
||||||
tiny-skia = "0.8"
|
|
||||||
|
|
||||||
[dependencies.bytemuck]
|
[dependencies.bytemuck]
|
||||||
version = "1.4"
|
version = "1.4"
|
||||||
|
|
@ -48,6 +47,10 @@ path = "../native"
|
||||||
version = "0.7"
|
version = "0.7"
|
||||||
path = "../style"
|
path = "../style"
|
||||||
|
|
||||||
|
[dependencies.tiny-skia]
|
||||||
|
version = "0.8"
|
||||||
|
optional = true
|
||||||
|
|
||||||
[dependencies.image_rs]
|
[dependencies.image_rs]
|
||||||
version = "0.24"
|
version = "0.24"
|
||||||
package = "image"
|
package = "image"
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ use std::sync::Arc;
|
||||||
|
|
||||||
/// A rendering primitive.
|
/// A rendering primitive.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum Primitive {
|
pub enum Primitive {
|
||||||
/// A text primitive
|
/// A text primitive
|
||||||
Text {
|
Text {
|
||||||
|
|
@ -85,12 +86,14 @@ pub enum Primitive {
|
||||||
/// The [`Gradient`] to apply to the mesh.
|
/// The [`Gradient`] to apply to the mesh.
|
||||||
gradient: Gradient,
|
gradient: Gradient,
|
||||||
},
|
},
|
||||||
|
#[cfg(feature = "tiny_skia")]
|
||||||
Fill {
|
Fill {
|
||||||
path: tiny_skia::Path,
|
path: tiny_skia::Path,
|
||||||
paint: tiny_skia::Paint<'static>,
|
paint: tiny_skia::Paint<'static>,
|
||||||
rule: tiny_skia::FillRule,
|
rule: tiny_skia::FillRule,
|
||||||
transform: tiny_skia::Transform,
|
transform: tiny_skia::Transform,
|
||||||
},
|
},
|
||||||
|
#[cfg(feature = "tiny_skia")]
|
||||||
Stroke {
|
Stroke {
|
||||||
path: tiny_skia::Path,
|
path: tiny_skia::Path,
|
||||||
paint: tiny_skia::Paint<'static>,
|
paint: tiny_skia::Paint<'static>,
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ path = "../native"
|
||||||
[dependencies.iced_graphics]
|
[dependencies.iced_graphics]
|
||||||
version = "0.7"
|
version = "0.7"
|
||||||
path = "../graphics"
|
path = "../graphics"
|
||||||
|
features = ["tiny-skia"]
|
||||||
|
|
||||||
[dependencies.cosmic-text]
|
[dependencies.cosmic-text]
|
||||||
features = ["std", "swash"]
|
features = ["std", "swash"]
|
||||||
|
|
|
||||||
|
|
@ -265,9 +265,8 @@ impl<'a> Layer<'a> {
|
||||||
current_layer,
|
current_layer,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Primitive::Fill { .. } | Primitive::Stroke { .. } => {
|
_ => {
|
||||||
// Unsupported!
|
// Unsupported!
|
||||||
// TODO: Draw a placeholder (?)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue