From 5f26ec870e42877675f20f001e58375091afce7f Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 13 Sep 2022 10:41:45 +0200 Subject: [PATCH] Corrected placement of tooltips --- src/tooltips.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tooltips.cpp b/src/tooltips.cpp index bfbe4e9..450d6da 100644 --- a/src/tooltips.cpp +++ b/src/tooltips.cpp @@ -196,11 +196,14 @@ void Tooltip::show(bool disregard_drawn, const std::function &on_motion) int min_x = rect.get_x(); int max_x = rect.get_x() + rect.get_width(); int height = 0; + int max_height = 0; while(true) { + tooltip_text_view->get_iter_location(iter, rect); + max_height = std::max(max_height, rect.get_height()); if(iter.ends_line()) { - tooltip_text_view->get_iter_location(iter, rect); max_x = std::max(max_x, rect.get_x() + rect.get_width()); - height += rect.get_height(); + height += max_height; + max_height = 0; } if(iter.is_end()) break;