Implement textual hit testing
This commit is contained in:
parent
8333b8f88c
commit
aa63841e2c
13 changed files with 341 additions and 75 deletions
|
|
@ -1,8 +1,8 @@
|
|||
use crate::{
|
||||
button, checkbox, column, container, pane_grid, progress_bar, radio, row,
|
||||
scrollable, slider, text, text_input, toggler, Color, Element, Font,
|
||||
HorizontalAlignment, Layout, Padding, Point, Rectangle, Renderer, Size,
|
||||
VerticalAlignment,
|
||||
HitTestResult, HorizontalAlignment, Layout, Padding, Point, Rectangle,
|
||||
Renderer, Size, Vector, VerticalAlignment,
|
||||
};
|
||||
|
||||
/// A renderer that does nothing.
|
||||
|
|
@ -67,6 +67,18 @@ impl text::Renderer for Null {
|
|||
(0.0, 20.0)
|
||||
}
|
||||
|
||||
fn hit_test(
|
||||
&self,
|
||||
_contents: &str,
|
||||
_size: f32,
|
||||
_font: Self::Font,
|
||||
_bounds: Size,
|
||||
_point: Point,
|
||||
_nearest_only: bool,
|
||||
) -> HitTestResult {
|
||||
HitTestResult::NearestCharOffset(0, Vector::new(0., 0.))
|
||||
}
|
||||
|
||||
fn draw(
|
||||
&mut self,
|
||||
_defaults: &Self::Defaults,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue