Remove dispatch_event from Element trait

This commit is contained in:
Nathan Sobo 2022-10-16 13:08:25 -06:00
parent d25c6b15a6
commit 12eab6551f
26 changed files with 288 additions and 736 deletions

View file

@ -4,8 +4,7 @@ use crate::{
geometry::{rect::RectF, vector::Vector2F},
json::json,
presenter::MeasurementContext,
DebugContext, Element, ElementBox, Event, EventContext, LayoutContext, PaintContext,
SizeConstraint,
DebugContext, Element, ElementBox, LayoutContext, PaintContext, SizeConstraint,
};
pub struct Hook {
@ -56,18 +55,6 @@ impl Element for Hook {
self.child.paint(bounds.origin(), visible_bounds, cx);
}
fn dispatch_event(
&mut self,
event: &Event,
_: RectF,
_: RectF,
_: &mut Self::LayoutState,
_: &mut Self::PaintState,
cx: &mut EventContext,
) -> bool {
self.child.dispatch_event(event, cx)
}
fn rect_for_text_range(
&self,
range_utf16: Range<usize>,