Repository: flutter
Issue:  `TextWidthBasis.longestLine` with `TextOverflow.ellipsis` produces clipped text
Labels: framework,a: typography,platform-web,customer: google,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.25

## Description

When using a `Text` widget with both `overflow: TextOverflow.ellipsis` and `textAlign: TextAlign.center`, it clips the start of the text instead of ellipsizing to size first and then centering.

@LongCatIsLooong  suggested that it may be due to:

> It's hard to tell what exactly happened without a repro, but the "longestLine" calculation does happen before ellipsization so it could be inaccurate:
> https://github.com/google/skia/blob/298a39597601ca5a60efb7bf4f49a91a6133a58c/modules/skparagraph/src/ParagraphImpl.cpp#L653-L658

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          color: Colors.red,
          width: 74,
          child: Center(
            child: Text(
              'Hello, World!',
              style: TextStyle(fontSize: 32),
              overflow: TextOverflow.ellipsis,
              textAlign: TextAlign.center,
              maxLines: 1,
              textWidthBasis: TextWidthBasis.longestLine,
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

<details open>
<summary>Screenshot</summary>

![image](https://github.com/user-attachments/assets/92235aa7-caba-4154-9d7d-f1b93cfd3aed)

</details>

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel main, 3.25.0-1.0.pre.162, on Debian GNU/Linux rodete 6.9.10-1rodete4-amd64, locale en_US.UTF-8)
    • Flutter version 3.25.0-1.0.pre.162 on channel main at /usr/local/google/home/gspencer/code/flutter
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision 446be11037 (2 minutes ago), 2024-08-28 10:20:12 -0700
    • Engine revision 8d248aead3
    • Dart version 3.6.0 (build 3.6.0-175.0.dev)
    • DevTools version 2.39.0-dev.15

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /usr/local/google/home/gspencer/Android/Sdk
    • Platform android-34, build-tools 33.0.1
    • ANDROID_HOME = /usr/local/google/home/gspencer/Android/Sdk
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.12+7-Debian-1build1)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 16.0.6 (26)
    • cmake version 3.29.6
    • ninja version 1.12.1
    • pkg-config version 1.8.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Debian GNU/Linux rodete 6.9.10-1rodete4-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 128.0.6613.84

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

```

</details>