@@ -91,7 +91,6 @@ impl Configure for Tooltip {
91
91
update_tooltip_text,
92
92
)
93
93
. in_set ( UpdateSet :: SyncLate )
94
- . after ( detect_tooltip_hover)
95
94
. run_if ( on_event :: < TooltipHover > ( ) ) ,
96
95
) ;
97
96
app. add_systems (
@@ -184,12 +183,11 @@ struct TooltipHover(Option<Entity>);
184
183
impl Configure for TooltipHover {
185
184
fn configure ( app : & mut App ) {
186
185
app. add_event :: < TooltipHover > ( ) ;
187
- app. add_systems ( Update , detect_tooltip_hover. in_set ( UpdateSet :: SyncLate ) ) ;
186
+ app. add_systems ( Update , detect_tooltip_hover. in_set ( UpdateSet :: RecordInput ) ) ;
188
187
}
189
188
}
190
189
191
190
fn detect_tooltip_hover (
192
- entities : & Entities ,
193
191
mut events : EventWriter < TooltipHover > ,
194
192
tooltip_root : Res < TooltipRoot > ,
195
193
tooltip_query : Query < & Selection > ,
@@ -206,15 +204,13 @@ fn detect_tooltip_hover(
206
204
continue ;
207
205
}
208
206
209
- // Show tooltip.
207
+ // Hovering something new: Update tooltip.
210
208
if selection. 0 != entity {
211
209
events. send ( TooltipHover ( Some ( entity) ) ) ;
212
210
}
213
211
return ;
214
212
}
215
213
216
- // Hide tooltip.
217
- if entities. contains ( selection. 0 ) {
218
- events. send ( TooltipHover ( None ) ) ;
219
- }
214
+ // Not hovering anything: Hide tooltip.
215
+ events. send ( TooltipHover ( None ) ) ;
220
216
}
0 commit comments