Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 12 Oct 2023 20:46:40 UTC Commit: 3498fe12a3be953511b810e568991e4149f2613a https://github.com/geany/geany/commit/3498fe12a3be953511b810e568991e4149f261...
Log Message: ----------- Fix popup position on a wrapping corner case
Modified Paths: -------------- src/symbols.c
Modified: src/symbols.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -1419,7 +1419,8 @@ static void show_menu_at_caret(GtkMenu* menu, ScintillaObject *sci) gint y = SSM(sci, SCI_POINTYFROMPOSITION, 0, pos); gint pos_next = sci_get_position_after(sci, pos); gint char_width = 0; - if (sci_get_line_from_position(sci, pos_next) == line) + /* if next pos is on the same Y (same line and not after wrapping), diff the X */ + if (pos_next > pos && SSM(sci, SCI_POINTYFROMPOSITION, 0, pos_next) == y) char_width = SSM(sci, SCI_POINTXFROMPOSITION, 0, pos_next) - x; GdkRectangle rect = {x, y, char_width, line_height}; gtk_menu_popup_at_rect(GTK_MENU(menu), window, &rect, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).