diff options
-rwxr-xr-x | control-center | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/control-center b/control-center index bc4ed729..9d1b1956 100755 --- a/control-center +++ b/control-center @@ -494,7 +494,7 @@ foreach (@tree) { $darea_left->modify_font($fonts[$curr_state]); ($lines, $widths, $heights) = (get_text_coord($text, $darea_left, $d_width-$left_txt_offset-$right_text_offset, $d_height, 0, 0, 0, 0))[2..4]; - my $offset = -12 + (listlength(@$lines) > 1 ? $heights->[0]/2 +7 : 0); # multi line texts are offsetted; but -12 and +7 are pure black magic + my $offset = -($d_height - string_height($darea_left, $lines->[0]) * (listlength(@$lines) +0.2)) / 2 ; # text lines are offsetted mapn { $dbl_area_left[$curr_state]->draw_layout($darea_left->style->black_gc, $_[1]+$left_txt_offset, $_[2]-$offset, $darea_left->create_pango_layout($_[0])); } $lines, $widths, $heights; |