Skip to content

the Transform widget is not working as expected when transform is a 2D translation #111855

@ColdPaleLight

Description

@ColdPaleLight

It can reproduce on master channel.

Reproduce code

Code
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'dart:ui' as ui;

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: const MyStatelessWidget(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Transform(
            transform: Matrix4.fromFloat64List(Float64List.fromList([
              1, 0, 0, 0, //
              0, 1, 0, 0, //
              0, 0, 1, 0, //
              100, 100, 0, 1, //
            ])),
            child: ImageFiltered(
                imageFilter: ui.ImageFilter.matrix(Float64List.fromList([
                  0.707, 0.707, 0, 0, //
                  -0.707, 0.707, 0, 0, //
                  0, 0, 1, 0, //
                  0, 0, 0, 1, //
                ])),
                child: Container(
                  color: Colors.red,
                  width: 200,
                  height: 200,
                ))),
        Container(
          width: 100,
          height: 100,
          color: Colors.blue,
        )
      ],
    );
  }
}

Expected result

Image

Actual result

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: layoutSystemChrome and Framework's Layout Issuesfound in release: 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4frameworkflutter/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