[PATCH] nsvi: account for zoom in follow hint placement
Export this patch
Fixes: https://todo.sr.ht/~sircmpwn/visurf/55
---
frontends/visurf/commands.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/frontends/visurf/commands.c b/frontends/visurf/commands.c
index b244511d6..ed4adaeef 100644
--- a/frontends/visurf/commands.c
+++ b/frontends/visurf/commands.c
@@ -182,7 +182,9 @@ follow_collect_hints(struct gui_window *win, struct box *node, int x, int y)
follow->zhint * sizeof(struct link_hint));
}
struct link_hint *hint = &follow->hints[follow->nhint];
- hint->x = x + node->x, hint->y = y + node->y;
+ float scale = browser_window_get_scale(win->bw);
+ hint->x = lroundf(scale * (x + node->x));
+ hint->y = lroundf(scale * (y + node->y));
hint->width = node->width, hint->height = node->height;
hint->url = node->href;
++follow->nhint;
--
2.34.1
Thanks!
To git@git.sr.ht:~sircmpwn/visurf
6be410ec3..0cad23641 master -> master