@@ -38,7 +38,10 @@ void ui::widget::update(update_context &ctx) {
3838 anim->update (ctx.delta_t );
3939 }
4040}
41- bool ui::update_context::hovered (widget *w) const {
41+ bool ui::update_context::hovered (widget *w, bool hittest) const {
42+ if (hittest && !hovered_widgets.empty ())
43+ return false ;
44+
4245 return w->check_hit (*this );
4346}
4447float ui::widget::measure_height (update_context &ctx) { return height->dest (); }
@@ -87,10 +90,14 @@ void ui::widget_parent_flex::update(update_context &ctx) {
8790void ui::update_context::set_hit_hovered (widget *w) {
8891 hovered_widgets.push_back (w->shared_from_this ());
8992}
90- bool ui::update_context::mouse_clicked_on (widget *w) const {
93+ bool ui::update_context::mouse_clicked_on (widget *w, bool hittest) const {
94+ if (hittest && !clicked_widgets.empty ())
95+ return false ;
9196 return mouse_clicked && hovered (w);
9297}
93- bool ui::update_context::mouse_down_on (widget *w) const {
98+ bool ui::update_context::mouse_down_on (widget *w, bool hittest) const {
99+ if (hittest && !hovered_widgets.empty ())
100+ return false ;
94101 return mouse_down && hovered (w);
95102}
96103void ui::update_context::set_hit_clicked (widget *w) {
@@ -117,6 +124,4 @@ bool ui::widget::check_hit(const update_context &ctx) {
117124 ctx.mouse_y >= (y->dest () + ctx.offset_y ) &&
118125 ctx.mouse_y <= (y->dest () + height->dest () + ctx.offset_y );
119126}
120- void ui::widget::render (nanovg_context ctx) {
121-
122- }
127+ void ui::widget::render (nanovg_context ctx) {}
0 commit comments