From e914888f57394e4b67b40e42f1ad9df4ae8147e6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 18:40:39 +0700 Subject: Implement `Widget::draw` for `TextInput` --- graphics/src/widget/text.rs | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'graphics/src/widget/text.rs') diff --git a/graphics/src/widget/text.rs b/graphics/src/widget/text.rs index 4ee2c616..ec0349f9 100644 --- a/graphics/src/widget/text.rs +++ b/graphics/src/widget/text.rs @@ -1,51 +1,7 @@ //! Write some text for your users to read. -use crate::backend::{self, Backend}; use crate::Renderer; -use iced_native::text; -use iced_native::{Font, Point, Size}; /// A paragraph of text. /// /// This is an alias of an `iced_native` text with an `iced_wgpu::Renderer`. pub type Text = iced_native::Text>; - -use std::f32; - -impl text::Renderer for Renderer -where - B: Backend + backend::Text, -{ - fn default_size(&self) -> u16 { - self.backend().default_size() - } - - fn measure( - &self, - content: &str, - size: u16, - font: Font, - bounds: Size, - ) -> (f32, f32) { - self.backend() - .measure(content, f32::from(size), font, bounds) - } - - fn hit_test( - &self, - content: &str, - size: f32, - font: Font, - bounds: Size, - point: Point, - nearest_only: bool, - ) -> Option { - self.backend().hit_test( - content, - size, - font, - bounds, - point, - nearest_only, - ) - } -} -- cgit