Browse Source

Corrected placement of tooltips

merge-requests/413/head
eidheim 3 years ago
parent
commit
5f26ec870e
  1. 7
      src/tooltips.cpp

7
src/tooltips.cpp

@ -196,11 +196,14 @@ void Tooltip::show(bool disregard_drawn, const std::function<void()> &on_motion)
int min_x = rect.get_x(); int min_x = rect.get_x();
int max_x = rect.get_x() + rect.get_width(); int max_x = rect.get_x() + rect.get_width();
int height = 0; int height = 0;
int max_height = 0;
while(true) { while(true) {
tooltip_text_view->get_iter_location(iter, rect);
max_height = std::max(max_height, rect.get_height());
if(iter.ends_line()) { if(iter.ends_line()) {
tooltip_text_view->get_iter_location(iter, rect);
max_x = std::max(max_x, rect.get_x() + rect.get_width()); 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()) if(iter.is_end())
break; break;

Loading…
Cancel
Save