-Clip text position auto-centers irrelevant of size

main
Harry van Haaren 2013-12-04 12:58:59 +00:00
parent 6d7b84a0a2
commit da92d83c84
1 changed files with 8 additions and 1 deletions

View File

@ -105,6 +105,13 @@ void ClipSelector::draw()
int clipWidth = w - 2;
int clipHeight = (h / numClips);
// small 22, 13
// start 29, 17
int textHeight = 13 + ((clipHeight - 22) * 0.66 );
printf("clipHeight %i\n", clipHeight);
int xOff = x+clipHeight/2;
int drawY = y + 1;
@ -191,7 +198,7 @@ void ClipSelector::draw()
cairo_stroke(cr);
// clip name
cairo_move_to( cr, x + clipHeight + 10, drawY + 17 );
cairo_move_to( cr, x + clipHeight + 5, drawY + textHeight );
cairo_set_source_rgba( cr, 255 / 255.f, 255 / 255.f , 255 / 255.f , 0.9 );
cairo_set_font_size( cr, 11 );
cairo_show_text( cr, clips[i].getName().c_str() );