diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-12 20:04:01 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-12 20:05:46 +0200 |
commit | c9cfc31cfdc5fe5e64b18afb91941b5d4fc63c1c (patch) | |
tree | 0134c605bf5430b1d82e5b8ad75d45ee5753795d | |
parent | 088eb5f137c38bdcde4fc2e80fd40cf7c07fce9b (diff) |
DocumentWidget: Slightly larger link click regions
Now that links have margins between them, make them easier to hit.
-rw-r--r-- | src/ui/documentwidget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index c9878f65..a65a5f11 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -492,7 +492,8 @@ static void updateHover_DocumentWidget_(iDocumentWidget *d, iInt2 mouse) { | |||
492 | (d->state == ready_RequestState || d->state == receivedPartialResponse_RequestState)) { | 492 | (d->state == ready_RequestState || d->state == receivedPartialResponse_RequestState)) { |
493 | iConstForEach(PtrArray, i, &d->visibleLinks) { | 493 | iConstForEach(PtrArray, i, &d->visibleLinks) { |
494 | const iGmRun *run = i.ptr; | 494 | const iGmRun *run = i.ptr; |
495 | if (contains_Rect(run->bounds, hoverPos)) { | 495 | /* Click targets are slightly expanded so there are no gaps between links. */ |
496 | if (contains_Rect(expanded_Rect(run->bounds, init1_I2(gap_Text / 2)), hoverPos)) { | ||
496 | d->hoverLink = run; | 497 | d->hoverLink = run; |
497 | break; | 498 | break; |
498 | } | 499 | } |