Skip to content

Regression in center-aligned text layout #17502

@tvolkert

Description

@tvolkert

Consider the following app:

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

void main() {
  runApp(new BuggyApp());
}

class BuggyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Bug Repro',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new BuggyWidget(),
    );
  }
}

class BuggyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Buggy'),
      ),
      body: new Padding(
        padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
        child: new RichText(
          textAlign: TextAlign.center,
          text: new TextSpan(
            text:
                'Give these coordinates a name to save the location '
                'in your Google Travel map.',
            style: Theme.of(context).textTheme.body1.copyWith(
              color: const Color(0xFF5F6368),
            ),
          ),
        ),
      ),
    );
  }
}

The text should be center aligned, but after flutter/engine#5190, the layout regressed:

text-layout

/cc @jason-simmons

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: typographyText rendering, possibly libtxtc: regressionIt was better in the past than it is now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions