Make Frame::fill_text take a generic Into<Text>

This commit is contained in:
Héctor Ramón Jiménez 2020-04-14 06:40:22 +02:00
parent dce1034699
commit 6779fcf621

View File

@ -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 {