From 2ea6ab216c749757a22529f7d822204ebea05d39 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Sat, 18 Feb 2012 16:39:47 +0100 Subject: [PATCH] Fix text height calculation. Closes #1078. --- src/placement_finder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/placement_finder.cpp b/src/placement_finder.cpp index 9e1704f43..2bb6cc00e 100644 --- a/src/placement_finder.cpp +++ b/src/placement_finder.cpp @@ -200,6 +200,7 @@ void placement_finder::init_string_size() first_line_space_ = std::max(first_line_space_, ci.line_height-ci.avg_height); } string_width_ -= info_.at(info_.num_characters()-1).format->character_spacing; //Remove last space + string_height_ -= first_line_space_; //First line is a bit smaller } @@ -377,7 +378,7 @@ void placement_finder::find_point_placement(double label_x, double la */ // set for upper left corner of text envelope for the first line, bottom left of first character - y = (string_height_ + first_line_space_) / 2.0 - line_height; + y = string_height_ / 2.0 - line_height; // adjust for desired justification if (p.jalign == J_LEFT)