Lagrange [release]

Fixed issues with text selection, range visualization

=> 8a38e2fd9418097ce03dc448de7560aac3899efa

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,
-                     .maxWidth = drawBoundWidth_GmRun(d),
+                     .mode     = anyCharacter_WrapTextMode,
+                     .maxWidth = isJustified_GmRun(d) ? drawBoundWidth_GmRun(d) : 0,
                      .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,
-                     .mode     = word_WrapTextMode,
-                     .maxWidth = iAbsi(drawBoundWidth_GmRun(run)),
+                     .mode     = anyCharacter_WrapTextMode,
+                     .maxWidth = isJustified_GmRun(run) ? iAbsi(drawBoundWidth_GmRun(run)) : 0,
                      .justify  = isJustified_GmRun(run),
                      .hitChar  = end };
     measure_WrapText(&wt, run->font);
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/release/cdiff/8a38e2fd9418097ce03dc448de7560aac3899efa
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
32.782282 milliseconds
Gemini-to-HTML Time
0.159403 milliseconds

This content has been proxied by September (ba2dc).