From da92d83c8421baed5305921c51453e679fd4041f Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Wed, 4 Dec 2013 12:58:59 +0000 Subject: [PATCH] -Clip text position auto-centers irrelevant of size --- src/avtk/clipselector.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/avtk/clipselector.cxx b/src/avtk/clipselector.cxx index 413add2..b364e78 100644 --- a/src/avtk/clipselector.cxx +++ b/src/avtk/clipselector.cxx @@ -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() );