|
13 | 13 | namespace flutter_runner { |
14 | 14 | namespace { |
15 | 15 |
|
16 | | -// Since the flatland hit-region can be transformed (rotated, scaled or |
17 | | -// translated), we must ensure that the size of the hit-region will not cause |
18 | | -// overflows on operations (like FLT_MAX would). |
19 | | -constexpr float kMaxHitRegionSize = 1'000'000.f; |
20 | | - |
21 | 16 | void AttachClipTransformChild( |
22 | 17 | FlatlandConnection* flatland, |
23 | 18 | FlatlandExternalViewEmbedder::ClipTransform* parent_clip_transform, |
@@ -59,19 +54,13 @@ FlatlandExternalViewEmbedder::FlatlandExternalViewEmbedder( |
59 | 54 | if (intercept_all_input) { |
60 | 55 | input_interceptor_transform_ = flatland_->NextTransformId(); |
61 | 56 | flatland_->flatland()->CreateTransform(*input_interceptor_transform_); |
| 57 | + flatland_->flatland()->SetInfiniteHitRegion( |
| 58 | + *input_interceptor_transform_, |
| 59 | + fuchsia::ui::composition::HitTestInteraction::SEMANTICALLY_INVISIBLE); |
62 | 60 |
|
63 | 61 | flatland_->flatland()->AddChild(root_transform_id_, |
64 | 62 | *input_interceptor_transform_); |
65 | 63 | child_transforms_.emplace_back(*input_interceptor_transform_); |
66 | | - |
67 | | - // Attach full-screen hit testing shield. Note that since the hit-region |
68 | | - // may be transformed (translated, rotated), we do not want to set |
69 | | - // width/height to FLT_MAX. This will cause a numeric overflow. |
70 | | - flatland_->flatland()->SetHitRegions( |
71 | | - *input_interceptor_transform_, |
72 | | - {{{0, 0, kMaxHitRegionSize, kMaxHitRegionSize}, |
73 | | - fuchsia::ui::composition::HitTestInteraction:: |
74 | | - SEMANTICALLY_INVISIBLE}}); |
75 | 64 | } |
76 | 65 | } |
77 | 66 |
|
@@ -453,9 +442,9 @@ void FlatlandExternalViewEmbedder::SubmitFrame( |
453 | 442 | flatland_layer_index++; |
454 | 443 | } |
455 | 444 |
|
456 | | - // Set up the input interceptor at the top of the |
457 | | - // scene, if applicable. It will capture all input, and any unwanted input |
458 | | - // will be reinjected into embedded views. |
| 445 | + // Set up the input interceptor at the top of the scene, if applicable. It |
| 446 | + // will capture all input, and any unwanted input will be reinjected into |
| 447 | + // embedded views. |
459 | 448 | if (input_interceptor_transform_.has_value()) { |
460 | 449 | flatland_->flatland()->AddChild(root_transform_id_, |
461 | 450 | *input_interceptor_transform_); |
|
0 commit comments