summaryrefslogtreecommitdiffstats
path: root/src/desktop-style.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/desktop-style.cpp')
-rw-r--r--src/desktop-style.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index c36bcee44..c28302d22 100644
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
@@ -1049,6 +1049,7 @@ objects_query_fontnumbers (const std::vector<SPItem*> &objects, SPStyle *style_r
double letterspacing_prev = 0;
double wordspacing_prev = 0;
double linespacing_prev = 0;
+ int linespacing_unit = 0;
int texts = 0;
int no_size = 0;
@@ -1105,6 +1106,11 @@ objects_query_fontnumbers (const std::vector<SPItem*> &objects, SPStyle *style_r
linespacing_current = style->line_height.computed;
linespacing_normal = false;
}
+ if (linespacing_unit == 0) {
+ linespacing_unit = style->line_height.unit;
+ } else if (linespacing_unit != style->line_height.unit) {
+ linespacing_unit = SP_CSS_UNIT_PERCENT;
+ }
linespacing += linespacing_current;
if ((size_prev != 0 && style->font_size.computed != size_prev) ||
@@ -1148,7 +1154,7 @@ objects_query_fontnumbers (const std::vector<SPItem*> &objects, SPStyle *style_r
style_res->line_height.normal = linespacing_normal;
style_res->line_height.computed = linespacing;
style_res->line_height.value = linespacing;
- style_res->line_height.unit = SP_CSS_UNIT_PERCENT;
+ style_res->line_height.unit = linespacing_unit;
if (texts > 1) {
if (different) {