From 0ca8d88853fcfdf8b8a5a36e1094def35a7a2184 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 15 Mar 2017 14:14:15 -0700 Subject: [PATCH] Update the PhysicalModelLayer child paint bounds to account for the shadow (flutter/engine#3478) See https://github.com/flutter/flutter/issues/8635 --- engine/src/flutter/flow/layers/physical_model_layer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/flow/layers/physical_model_layer.cc b/engine/src/flutter/flow/layers/physical_model_layer.cc index a2ff97b112..24050be7f9 100644 --- a/engine/src/flutter/flow/layers/physical_model_layer.cc +++ b/engine/src/flutter/flow/layers/physical_model_layer.cc @@ -20,8 +20,6 @@ PhysicalModelLayer::~PhysicalModelLayer() {} void PhysicalModelLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { PrerollChildren(context, matrix); - if (!context->child_paint_bounds.intersect(rrect_.getBounds())) - context->child_paint_bounds.setEmpty(); // Add some margin to the paint bounds to leave space for the shadow. // The margin is hardcoded to an arbitrary maximum for now because Skia @@ -29,6 +27,8 @@ void PhysicalModelLayer::Preroll(PrerollContext* context, const SkMatrix& matrix SkRect bounds(rrect_.getBounds()); bounds.outset(50.0, 50.0); set_paint_bounds(bounds); + + context->child_paint_bounds = bounds; } #if defined(OS_FUCHSIA)