未验证 提交 4737fc5c 编写于 作者: L Lau Ching Jun 提交者: GitHub

Initialize OpacityLayer's matrix to identity (#8467) (#8548)

Should have https://github.com/flutter/flutter/issues/30586 fixed once the engine rolls.
上级 cc115500
......@@ -20,6 +20,13 @@ void OpacityLayer::EnsureSingleChild() {
}
auto new_child = std::make_shared<flow::TransformLayer>();
// Be careful: SkMatrix's default constructor doesn't initialize the matrix to
// identity. Hence we have to explicitly call SkMatrix::setIdentity.
SkMatrix identity;
identity.setIdentity();
new_child->set_transform(identity);
for (auto& child : layers()) {
new_child->Add(child);
}
......
......@@ -9,6 +9,8 @@
namespace flow {
// Be careful that SkMatrix's default constructor doesn't initialize the matrix
// at all. Hence |set_transform| must be called with an initialized SkMatrix.
class TransformLayer : public ContainerLayer {
public:
TransformLayer();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册