13
0

amend/fix b490f7d2a1 to correctly (?) place marker text

This commit is contained in:
Paul Davis 2023-07-01 21:07:06 -06:00
parent 3be6ae57ba
commit 64d633cd26
2 changed files with 10 additions and 4 deletions

View File

@ -357,13 +357,19 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::s
int width;
layout->set_font_description (name_font);
Gtkmm2ext::get_ink_pixel_size (layout, width, name_height);
Gtkmm2ext::get_ink_pixel_size_with_descent (layout, width, name_height, name_descent);
/* compute descent below baseline, since pango returns the overall
height from descender to top ... what were they thinking?
*/
name_descent -= name_height;
_name_item = new ArdourCanvas::Text (group);
CANVAS_DEBUG_NAME (_name_item, string_compose ("ArdourMarker::_name_item for %1", annotation));
_name_item->set_font_description (name_font);
_name_item->set_color (RGBA_TO_UINT (0,0,0,255));
_name_item->set_position (ArdourCanvas::Duple (_label_offset, (marker_height - 4)*0.5 - (name_height) * .5 ));
_name_item->set_position (ArdourCanvas::Duple (_label_offset, -name_descent));
apply_color ();
@ -611,8 +617,7 @@ ArdourMarker::setup_name_display ()
if (_name_flag) {
_name_flag->set_y0 (0);
_name_flag->set_y1 (marker_height - 2.);
_name_item->set_position (ArdourCanvas::Duple (2., (name_height - marker_height - 2.)));
_name_flag->set_y1 (marker_height - padding);
}
}

View File

@ -145,6 +145,7 @@ protected:
double _shift;
Type _type;
int name_height;
int name_descent;
bool _selected;
bool _entered;
bool _shown;