Make Frame::fill_text take a generic Into<Text>
This commit is contained in:
parent
dce1034699
commit
6779fcf621
1 changed files with 3 additions and 1 deletions
|
|
@ -175,9 +175,11 @@ impl Frame {
|
||||||
/// [`Text`]: struct.Text.html
|
/// [`Text`]: struct.Text.html
|
||||||
/// [`Frame`]: struct.Frame.html
|
/// [`Frame`]: struct.Frame.html
|
||||||
/// [`Canvas`]: struct.Canvas.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;
|
use std::f32;
|
||||||
|
|
||||||
|
let text = text.into();
|
||||||
|
|
||||||
let position = if self.transforms.current.is_identity {
|
let position = if self.transforms.current.is_identity {
|
||||||
text.position
|
text.position
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue