diff options
author | 2019-09-19 15:01:12 +0200 | |
---|---|---|
committer | 2019-09-19 15:01:12 +0200 | |
commit | f9de39ddaa3020a9585b1648afb0ead45dfd7aa9 (patch) | |
tree | 04289787e353b4b059354d22ce53f2b79464431c /examples/tour/renderer/text.rs | |
parent | dd093c79d7da84675be648c7df2ebfc85b5039f2 (diff) | |
download | iced-f9de39ddaa3020a9585b1648afb0ead45dfd7aa9.tar.gz iced-f9de39ddaa3020a9585b1648afb0ead45dfd7aa9.tar.bz2 iced-f9de39ddaa3020a9585b1648afb0ead45dfd7aa9.zip |
Unify `web` and `ggez` tour examples :tada:
Diffstat (limited to '')
-rw-r--r-- | examples/tour/src/iced_ggez/renderer/text.rs (renamed from examples/tour/renderer/text.rs) | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/tour/renderer/text.rs b/examples/tour/src/iced_ggez/renderer/text.rs index ecf1481e..b5010639 100644 --- a/examples/tour/renderer/text.rs +++ b/examples/tour/src/iced_ggez/renderer/text.rs @@ -1,11 +1,11 @@ -use super::Renderer; -use ggez::graphics::{self, mint, Align, Color, Scale, Text, TextFragment}; +use super::{into_color, Renderer}; +use ggez::graphics::{self, mint, Align, Scale, Text, TextFragment}; use iced::text; use std::cell::RefCell; use std::f32; -impl text::Renderer<Color> for Renderer<'_> { +impl text::Renderer<iced::Color> for Renderer<'_> { fn node( &self, style: iced::Style, @@ -80,7 +80,7 @@ impl text::Renderer<Color> for Renderer<'_> { bounds: iced::Rectangle, content: &str, size: Option<u16>, - color: Option<Color>, + color: Option<iced::Color>, horizontal_alignment: text::HorizontalAlignment, _vertical_alignment: text::VerticalAlignment, ) { @@ -112,7 +112,7 @@ impl text::Renderer<Color> for Renderer<'_> { x: bounds.x, y: bounds.y, }, - color.or(Some(graphics::BLACK)), + color.or(Some(iced::Color::BLACK)).map(into_color), ); } } |