summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-14 06:40:22 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-14 06:40:22 +0200
commit6779fcf62134397671cdb7d3c406262911dcc4c8 (patch)
treece9dac63c3e30f50b2e7d8b6be135758ba064958 /wgpu
parentdce1034699daee67138a54944c174c0aa5aec9dd (diff)
downloadiced-6779fcf62134397671cdb7d3c406262911dcc4c8.tar.gz
iced-6779fcf62134397671cdb7d3c406262911dcc4c8.tar.bz2
iced-6779fcf62134397671cdb7d3c406262911dcc4c8.zip
Make `Frame::fill_text` take a generic `Into<Text>`
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/widget/canvas/frame.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/wgpu/src/widget/canvas/frame.rs b/wgpu/src/widget/canvas/frame.rs
index f22d7887..de4717f1 100644
--- a/wgpu/src/widget/canvas/frame.rs
+++ b/wgpu/src/widget/canvas/frame.rs
@@ -175,9 +175,11 @@ impl Frame {
/// [`Text`]: struct.Text.html
/// [`Frame`]: struct.Frame.html
/// [`Canvas`]: struct.Canvas.html
- pub fn fill_text(&mut self, text: Text) {
+ pub fn fill_text(&mut self, text: impl Into<Text>) {
use std::f32;
+ let text = text.into();
+
let position = if self.transforms.current.is_identity {
text.position
} else {