From c9cfc31cfdc5fe5e64b18afb91941b5d4fc63c1c Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 12 Mar 2021 20:04:01 +0200 Subject: DocumentWidget: Slightly larger link click regions Now that links have margins between them, make them easier to hit. --- src/ui/documentwidget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ui/documentwidget.c') 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) { (d->state == ready_RequestState || d->state == receivedPartialResponse_RequestState)) { iConstForEach(PtrArray, i, &d->visibleLinks) { const iGmRun *run = i.ptr; - if (contains_Rect(run->bounds, hoverPos)) { + /* Click targets are slightly expanded so there are no gaps between links. */ + if (contains_Rect(expanded_Rect(run->bounds, init1_I2(gap_Text / 2)), hoverPos)) { d->hoverLink = run; break; } -- cgit v1.2.3