Skip to content

Transform.scale and ScaleTransform should avoid painting/compositing when scale is 0 #106974

@jonahwilliams

Description

@jonahwilliams

Discovered while working on #106621 , a ScaleTransform to 0 will still push a layer and paint all children even though it is technically invisible.

See https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/rendering/proxy_box.dart#L2606-L2617

This code will fail to create an offset and instead push a transform like

[0] 0.0,0.0,0.0,0.0
I/flutter (21672): [1] 0.0,0.0,0.0,0.0
I/flutter (21672): [2] 0.0,0.0,1.0,0.0
I/flutter (21672): [3] 0.0,0.0,0.0,1.0

Instead we should probably short-circuit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions