File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -407,9 +407,8 @@ impl HitTester {
407
407
}
408
408
409
409
// See if any of the clips for this primitive cull out the item.
410
- let mut is_valid = true ;
411
410
let clip_nodes = & self . scene . clip_nodes [ item. clip_nodes_range . start . 0 as usize .. item. clip_nodes_range . end . 0 as usize ] ;
412
- for clip_node in clip_nodes {
411
+ let is_valid = clip_nodes. iter ( ) . all ( |clip_node| {
413
412
let transform = self
414
413
. spatial_nodes [ & clip_node. spatial_node_index ]
415
414
. world_content_transform ;
@@ -418,13 +417,13 @@ impl HitTester {
418
417
. and_then ( |inverted| inverted. transform_point2d ( test. point ) )
419
418
{
420
419
Some ( point) => point,
421
- None => continue ,
420
+ // XXX This `return true` is a bit sketchy, but matches
421
+ // pre-existing behavior.
422
+ None => return true ,
422
423
} ;
423
- if !clip_node. region . contains ( & transformed_point) {
424
- is_valid = false ;
425
- break ;
426
- }
427
- }
424
+ clip_node. region . contains ( & transformed_point)
425
+ } ) ;
426
+
428
427
if !is_valid {
429
428
continue ;
430
429
}
You can’t perform that action at this time.
0 commit comments