From 4ab948ecee611477e8fbe7c31f27b1fe08feee8d Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 10 Mar 2016 18:33:08 -0800 Subject: [PATCH] Specify a clip rect for ChildSceneLayers. When linking in a scene, it's a good idea to specify its clip rectangle to ensure that its content does not draw or capture input from its surrounding space. A future version of the Mozart view manager may automatically wrap a view's scene with a clip rectangle to avoid composition gotchas like this but it currently doesn't. So the net effect is that if you embed a view without specifying a clip, it can draw or capture input from anywhere within its container. --- engine/src/flutter/flow/layers/child_scene_layer.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/flutter/flow/layers/child_scene_layer.cc b/engine/src/flutter/flow/layers/child_scene_layer.cc index 78d69a62c8..1ff894bc5e 100644 --- a/engine/src/flutter/flow/layers/child_scene_layer.cc +++ b/engine/src/flutter/flow/layers/child_scene_layer.cc @@ -38,6 +38,9 @@ void ChildSceneLayer::UpdateScene(mojo::gfx::composition::SceneUpdate* update, child_node->op = mojo::gfx::composition::NodeOp::New(); child_node->op->set_scene(mojo::gfx::composition::SceneNodeOp::New()); child_node->op->get_scene()->scene_resource_id = id; + child_node->content_clip = mojo::RectF::New(); + child_node->content_clip->width = physical_size_.width(); + child_node->content_clip->height = physical_size_.height(); child_node->content_transform = mojo::Transform::From(transform_); update->nodes.insert(id, child_node.Pass()); container->child_node_ids.push_back(id);