summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Imbris <imbrisf@gmail.com>2020-05-27 01:33:16 -0400
committerLibravatar Imbris <imbrisf@gmail.com>2020-05-27 22:12:38 -0400
commit0a775191abad5787af3aaa302d5599ef12060264 (patch)
tree83411e8cf2f1edf463c6679819b63b4e2e2e2111 /native
parent5324eb10242a7dd33f5271dc6fc9eeb09eb2cb50 (diff)
downloadiced-0a775191abad5787af3aaa302d5599ef12060264.tar.gz
iced-0a775191abad5787af3aaa302d5599ef12060264.tar.bz2
iced-0a775191abad5787af3aaa302d5599ef12060264.zip
Loosen bounds on Text Clone impl
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/text.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/native/src/widget/text.rs b/native/src/widget/text.rs
index d60aa468..0b05b67d 100644
--- a/native/src/widget/text.rs
+++ b/native/src/widget/text.rs
@@ -19,7 +19,7 @@ use std::hash::Hash;
/// ```
///
/// ![Text drawn by `iced_wgpu`](https://github.com/hecrj/iced/blob/7760618fb112074bc40b148944521f312152012a/docs/images/text.png?raw=true)
-#[derive(Debug, Clone)]
+#[derive(Debug)]
pub struct Text<Renderer: self::Renderer> {
content: String,
size: Option<u16>,
@@ -239,3 +239,18 @@ where
Element::new(text)
}
}
+
+impl<Renderer: self::Renderer> Clone for Text<Renderer> {
+ fn clone(&self) -> Self {
+ Self {
+ content: self.content.clone(),
+ size: self.size,
+ color: self.color,
+ font: self.font,
+ width: self.width,
+ height: self.height,
+ horizontal_alignment: self.horizontal_alignment,
+ vertical_alignment: self.vertical_alignment,
+ }
+ }
+}