summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-22 05:41:15 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-22 05:41:15 +0100
commit4f2f40c68b4647f281d34034beb159a41422aa06 (patch)
tree1fa11b5c4ed1bab19d5feff1beb122aa6a4955f5 /core/src
parent1f13a91361258a1607c71f4840a26a6437f88612 (diff)
downloadiced-4f2f40c68b4647f281d34034beb159a41422aa06.tar.gz
iced-4f2f40c68b4647f281d34034beb159a41422aa06.tar.bz2
iced-4f2f40c68b4647f281d34034beb159a41422aa06.zip
Fix standalone compilation of `iced_widget` crate
Diffstat (limited to 'core/src')
-rw-r--r--core/src/renderer.rs1
-rw-r--r--core/src/renderer/null.rs15
2 files changed, 16 insertions, 0 deletions
diff --git a/core/src/renderer.rs b/core/src/renderer.rs
index dfedcd45..6712314e 100644
--- a/core/src/renderer.rs
+++ b/core/src/renderer.rs
@@ -1,4 +1,5 @@
//! Write your own renderer.
+#[cfg(debug_assertions)]
mod null;
use crate::{
diff --git a/core/src/renderer/null.rs b/core/src/renderer/null.rs
index af7dc15f..c26ce1a5 100644
--- a/core/src/renderer/null.rs
+++ b/core/src/renderer/null.rs
@@ -1,6 +1,7 @@
use crate::alignment;
use crate::image;
use crate::renderer::{self, Renderer};
+use crate::svg;
use crate::text::{self, Text};
use crate::{
Background, Color, Font, Pixels, Point, Rectangle, Size, Transformation,
@@ -177,3 +178,17 @@ impl image::Renderer for () {
) {
}
}
+
+impl svg::Renderer for () {
+ fn measure_svg(&self, _handle: &svg::Handle) -> Size<u32> {
+ Size::default()
+ }
+
+ fn draw_svg(
+ &mut self,
+ _handle: svg::Handle,
+ _color: Option<Color>,
+ _bounds: Rectangle,
+ ) {
+ }
+}