Skip to content

CupertinoContextMenu animation is the wrong size when within Transform.scale #102061

@moffatman

Description

@moffatman

Top-left corner is correct but the size is wrong.

Demo program:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const CupertinoApp(
      title: 'Flutter Demo',
      home: MyHomePage()
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: const Color(0xFFFFFFFF),
      child: Transform.scale(
        scale: 0.5,
        child: Positioned(
          top: 100,
          left: 100,
          bottom: 100,
          right: 100,
          child: CupertinoContextMenu(
            actions: const [
              CupertinoContextMenuAction(
                child: Text('Do something')
              )
            ],
            child: Container(
              alignment: Alignment.topLeft,
              color: Colors.purple,
              child: const Text('Foobar')
            )
          )
        )
      )
    );
  }
}
Screen.Recording.2022-04-18.at.1.56.41.AM.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    f: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions