Show the hyperlink target bar on the top more often than the bottom. This is because the text cursor is usually closer to the bottom.

This commit is contained in:
Kovid Goyal 2023-01-05 15:28:02 +05:30
parent a548e3eb4d
commit 49418c2f53
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -635,7 +635,7 @@ draw_hyperlink_target(OSWindow *os_window, Screen *screen, const CellRenderData
bd->needs_render = true; bd->needs_render = true;
} }
if (bd->last_drawn_title_object_id == NULL) return; if (bd->last_drawn_title_object_id == NULL) return;
const bool along_bottom = screen->lines < 3 || screen->current_hyperlink_under_mouse.y < screen->lines - 2; const bool along_bottom = screen->current_hyperlink_under_mouse.y < 3;
PyObject *ref = bd->last_drawn_title_object_id; PyObject *ref = bd->last_drawn_title_object_id;
Py_INCREF(ref); Py_INCREF(ref);
render_a_bar(os_window, screen, crd, &window->title_bar_data, bd->last_drawn_title_object_id, along_bottom); render_a_bar(os_window, screen, crd, &window->title_bar_data, bd->last_drawn_title_object_id, along_bottom);