Skip to content

Handle overlapping ClipRRect on platform views correctly #179126

@Hari-07

Description

@Hari-07

In #177551 rounded rects are expected to have uniform radius. Further if there are multiple ClipRRect overlapping in each corner, the biggest radius ought to be used.

This issue is for tracking this enhancement to the implementation

Repo for reproducing

With this snippet

Widget build(BuildContext context) {
    return ClipRRect(
      borderRadius: const BorderRadius.only(
        topLeft: Radius.circular(50),
      ),
      child: Container(
        width: 200,
        height: 200,
        decoration: BoxDecoration(
          color: Colors.black.withOpacity(0.2),
          borderRadius: BorderRadius.circular(500),
        ),
        child: BackdropFilter(
          filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
          child: const Center(
            child: Text('Blurred block 1'),
          ),
        ),
      ),
    );
  }

the correct behaviour should round only the top left, but currently it produces

Image

This is because the implementation in #177551 is applying uniform radius to all corners reading from the top left. Similar case also applies when multiple ClipRRects are stacked, with topLeft from one and topRight from another one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterengineflutter/engine related. See also e: labels.team-iosOwned by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions