From 8a38e2fd9418097ce03dc448de7560aac3899efa Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Wed, 24 Aug 2022 20:47:26 +0300

Subject: [PATCH 1/1] Fixed issues with text selection, range visualization

Text position measurements had a few issues caused by the complexities introduced by justification and the related refactoring of the text renderer.

Now both position finding and selection range visualization should handle various situations better.

IssueID #515


src/gmdocument.c | 3 ++-

src/ui/documentwidget.c | 4 ++--

2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gmdocument.c b/src/gmdocument.c

index fd1de3b2..a9bea74c 100644

--- a/src/gmdocument.c

+++ b/src/gmdocument.c

@@ -2731,7 +2731,8 @@ iRangecc findLoc_GmRun(const iGmRun *d, iInt2 pos) {

 }

 iRangecc loc;

 iWrapText wt = { .text     = d->text,

                  .justify  = isJustified_GmRun(d),

                  .hitPoint = init_I2(x, 0) };

 measure_WrapText(&wt, d->font);

diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c

index 8e160fd3..4ad2bb20 100644

--- a/src/ui/documentwidget.c

+++ b/src/ui/documentwidget.c

@@ -1168,8 +1168,8 @@ struct Impl_DrawContext {

static int measureAdvanceToLoc_(const iGmRun *run, const char *end) {

 iWrapText wt = { .text     = run->text,

                  .justify  = isJustified_GmRun(run),

                  .hitChar  = end };

 measure_WrapText(&wt, run->font);

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/release/patch/8a38e2fd9418097ce03dc448de7560aac3899efa.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
38.78209 milliseconds
Gemini-to-HTML Time
0.578601 milliseconds

This content has been proxied by September (ba2dc).