Use Option to encode empty text case in hit test methods
This commit is contained in:
parent
93fec8d273
commit
643500bbdf
10 changed files with 59 additions and 52 deletions
|
|
@ -2,7 +2,7 @@ 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,
|
||||
Vector, VerticalAlignment,
|
||||
VerticalAlignment,
|
||||
};
|
||||
|
||||
/// A renderer that does nothing.
|
||||
|
|
@ -75,8 +75,8 @@ impl text::Renderer for Null {
|
|||
_bounds: Size,
|
||||
_point: Point,
|
||||
_nearest_only: bool,
|
||||
) -> text::Hit {
|
||||
text::Hit::NearestCharOffset(0, Vector::new(0., 0.))
|
||||
) -> Option<text::Hit> {
|
||||
None
|
||||
}
|
||||
|
||||
fn draw(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue