summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-08 03:13:41 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-08 03:13:41 +0200
commit10e10e5e06841574425d2633f1c2916733f7b4ff (patch)
tree0407a0136973a201fe44bfc1a94268544a2f8eb5 /wgpu/src/renderer/text.rs
parenta0234d5bcea5b25f575af01d3a8e0296b2d0395c (diff)
downloadiced-10e10e5e06841574425d2633f1c2916733f7b4ff.tar.gz
iced-10e10e5e06841574425d2633f1c2916733f7b4ff.tar.bz2
iced-10e10e5e06841574425d2633f1c2916733f7b4ff.zip
Make `iced_core::Button` customizable
Now it supports: - Any kind of content - Custom border radius - Custom background
Diffstat (limited to '')
-rw-r--r--wgpu/src/renderer/text.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/wgpu/src/renderer/text.rs b/wgpu/src/renderer/text.rs
index 4434cc22..c89c0b3e 100644
--- a/wgpu/src/renderer/text.rs
+++ b/wgpu/src/renderer/text.rs
@@ -1,5 +1,5 @@
use crate::{Primitive, Renderer};
-use iced_native::{text, Layout, Node, Style, Text};
+use iced_native::{text, Color, Layout, Node, Style, Text};
use wgpu_glyph::{GlyphCruncher, Section};
@@ -72,6 +72,9 @@ impl text::Renderer for Renderer {
content: text.content.clone(),
size: f32::from(text.size.unwrap_or(20)),
bounds: layout.bounds(),
+ color: text.color.unwrap_or(Color::BLACK),
+ horizontal_alignment: text.horizontal_alignment,
+ vertical_alignment: text.vertical_alignment,
}
}
}