summaryrefslogtreecommitdiffstats
path: root/graphics/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src/widget')
-rw-r--r--graphics/src/widget/text.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/graphics/src/widget/text.rs b/graphics/src/widget/text.rs
index 7e22e680..c235f254 100644
--- a/graphics/src/widget/text.rs
+++ b/graphics/src/widget/text.rs
@@ -4,7 +4,7 @@ use crate::{Primitive, Renderer};
use iced_native::mouse;
use iced_native::text;
use iced_native::{
- Color, Font, HorizontalAlignment, Rectangle, Size, VerticalAlignment,
+ Color, Font, HorizontalAlignment, Point, Rectangle, Size, VerticalAlignment,
};
/// A paragraph of text.
@@ -35,6 +35,25 @@ where
.measure(content, f32::from(size), font, bounds)
}
+ fn hit_test(
+ &self,
+ content: &str,
+ size: f32,
+ font: Font,
+ bounds: Size,
+ point: Point,
+ nearest_only: bool,
+ ) -> text::Hit {
+ self.backend().hit_test(
+ content,
+ size,
+ font,
+ bounds,
+ point,
+ nearest_only,
+ )
+ }
+
fn draw(
&mut self,
defaults: &Self::Defaults,