summaryrefslogtreecommitdiffstats
path: root/glow/src/text.rs
diff options
context:
space:
mode:
Diffstat (limited to 'glow/src/text.rs')
-rw-r--r--glow/src/text.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/glow/src/text.rs b/glow/src/text.rs
index bb882594..d6915d92 100644
--- a/glow/src/text.rs
+++ b/glow/src/text.rs
@@ -1,9 +1,12 @@
use crate::Transformation;
-use glow_glyph::ab_glyph;
+
use iced_graphics::font;
-use iced_native::HitTestResult;
+
+use glow_glyph::ab_glyph;
use std::{cell::RefCell, collections::HashMap};
+pub use iced_native::text::Hit;
+
#[derive(Debug)]
pub struct Pipeline {
draw_brush: RefCell<glow_glyph::GlyphBrush>,
@@ -118,7 +121,7 @@ impl Pipeline {
bounds: iced_native::Size,
point: iced_native::Point,
nearest_only: bool,
- ) -> HitTestResult {
+ ) -> Hit {
use glow_glyph::GlyphCruncher;
let glow_glyph::FontId(font_id) = self.find_font(font);
@@ -179,7 +182,7 @@ impl Pipeline {
if !nearest_only {
for (idx, bounds) in bounds.clone() {
if bounds.contains(point) {
- return HitTestResult::CharOffset(char_index(idx));
+ return Hit::CharOffset(char_index(idx));
}
}
}
@@ -195,10 +198,7 @@ impl Pipeline {
},
);
- HitTestResult::NearestCharOffset(
- char_index(idx),
- (point - nearest).into(),
- )
+ Hit::NearestCharOffset(char_index(idx), (point - nearest).into())
}
pub fn trim_measurement_cache(&mut self) {