Repository: flutter
Issue: RTL Text with TextOverflow.ellipsis property is not clipped correctly
Labels: platform-android,engine,a: internationalization,a: typography,platform-web,has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-engine,triaged-engine

This issue is similar to #99736 which should be fixed by now but still exist on Flutter stable 3.3.4 on Android/iOS/Web

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Press the increase or decrease button multiple times because if happens on certain sizes

or run via [Dartpad](https://dartpad.dev/?id=b53ff4486f6330395b7d46b9be8c9c33)

**Expected results:**
Text should be clipped inside the sizedbox with ellipsis on the left side of the text
**Actual results:** <!-- what did you see? -->
Text is not clipped correctly and ellipsis is on the right side of the text
<details>
<summary>Screen shots </summary>
Actual:

![image](https://user-images.githubusercontent.com/78305390/195896300-c6473043-c45a-43da-b6e0-76cb70342567.png)

Expected

![image](https://user-images.githubusercontent.com/78305390/195896359-a5b89ea2-2bed-4413-8b76-865d9fd56854.png)

Video demo:

![2022-10-14-19-32-53](https://user-images.githubusercontent.com/78305390/195899670-01442242-053b-4eef-8087-e98c5359ff64.gif)

</details>
<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```import 'package:flutter/material.dart';

Future<void> main() async {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  double width = 167;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Directionality(
        textDirection: TextDirection.rtl,
        child: Center(
            child: Column(
          children: [
            Container(
              color: Colors.yellow,
              width: width,
              child: const Text(
                'تظاهرات و تجمعات اعتراضی در سراسر کشور ۲۳ مهر',
                overflow: TextOverflow.ellipsis,
                maxLines: 2,
                style: TextStyle(
                  fontWeight: FontWeight.w700,
                  fontSize: 16,
                ),
              ),
            ),
            ElevatedButton(
                onPressed: () {
                  setState(() {
                    width++;
                  });
                },
                child: const Text('Increase width')),
            ElevatedButton(
                onPressed: () {
                  setState(() {
                    width--;
                  });
                },
                child: const Text('Decrease width')),
          ],
        )),
      ),
    );
  }
}

```

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->
log when the bug happens:
```
...
[+4519 ms] D/skia    (15989): ASSERT: 38.570648 != 164.250336
[+1126 ms] D/skia    (15989): ASSERT: 32.250336 != 170.015961
[ +749 ms] D/skia    (15989): ASSERT: 32.250336 != 170.015961
```

flutter analyze
```
Analyzing test_analytics...
No issues found! (ran in 2.4s)

```

flutter doctor -v
```
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.19042.1466], locale en-US)
    • Flutter version 3.3.4 on channel stable at E:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eb6d86ee27 (10 days ago), 2022-10-04 22:31:45 -0700
    • Engine revision c08d7d5efc
    • Dart version 2.18.2
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Sina\AppData\Local\Android\sdk
    • Platform android-33, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] IntelliJ IDEA Ultimate Edition (version 2020.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2020.1.1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.19042.1466]
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 106.0.5249.103
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 103.0.1264.62

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->