Skip to content

ShaderMask is broken by the shifting done by Align #10424

@Hixie

Description

@Hixie

This works:

import 'package:flutter/material.dart';

void main() {
  runApp(
    new Align(
      alignment: FractionalOffset.topLeft,
      child: new SizedBox(
        width: 400.0,
        height: 400.0,
        child: new FittedBox(
          child: new ShaderMask(
            shaderCallback: (Rect bounds) {
              return new RadialGradient(
                center: FractionalOffset.topLeft,
                radius: 1.0,
                colors: <Color>[Colors.yellow, Colors.deepOrange.shade900],
                tileMode: TileMode.repeated,
              ).createShader(bounds);
            },
            blendMode: BlendMode.modulate,
            child: const Text('I’m burning the memories'),
          ),
        ),
      ),
    ),
  );
}

If you change alignment: FractionalOffset.topLeft to alignment: FractionalOffset.center then it stops working.

cc @jason-simmons @abarth

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions