From 7c2da544c93c8b3e1987c058dbf28d49b9930318 Mon Sep 17 00:00:00 2001
From: singerdmx <singerdmx@gmail.com>
Date: Mon, 11 Jan 2021 20:17:53 -0800
Subject: [PATCH] Fix getExtentEndpointForSelection

---
 CHANGELOG.md               | 5 ++++-
 lib/widgets/text_line.dart | 3 ++-
 pubspec.yaml               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f619d325..1fd77a64 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,4 +42,7 @@
 * Handle url with trailing spaces.
 
 ## [0.1.5]
-* Support text alignment.
\ No newline at end of file
+* Support text alignment.
+
+## [0.1.6]
+* Fix getExtentEndpointForSelection.
\ No newline at end of file
diff --git a/lib/widgets/text_line.dart b/lib/widgets/text_line.dart
index b0ceb182..3cb9cb5a 100644
--- a/lib/widgets/text_line.dart
+++ b/lib/widgets/text_line.dart
@@ -564,7 +564,8 @@ class RenderEditableTextLine extends RenderEditableBox {
     assert(boxes.isNotEmpty);
     TextBox targetBox = first ? boxes.first : boxes.last;
     return TextSelectionPoint(
-        Offset(targetBox.start, targetBox.bottom), targetBox.direction);
+        Offset(first ? targetBox.start : targetBox.end, targetBox.bottom),
+        targetBox.direction);
   }
 
   @override
diff --git a/pubspec.yaml b/pubspec.yaml
index 1dc3fa52..ce34ecba 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
 name: flutter_quill
 description: One client and affiliated collaborator of Flutter Quill is Bullet Journal App.
-version: 0.1.5
+version: 0.1.6
 #author: bulletjournal
 homepage: https://bulletjournal.us/home/index.html
 repository: https://github.com/singerdmx/flutter-quill.git