From 1c9e7ee09d40b8e06b80d0a09eca17d1b0fb8357 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 12 Mar 2016 18:50:04 -0500 Subject: Add a units box to line height and wire in the style units, plus some cleanup (bzr r14701) --- src/style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 35138d25b..99beaed22 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -113,7 +113,7 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : font_weight( "font-weight", enum_font_weight, SP_CSS_FONT_WEIGHT_NORMAL, SP_CSS_FONT_WEIGHT_400 ), font_stretch( "font-stretch", enum_font_stretch, SP_CSS_FONT_STRETCH_NORMAL ), font_size(), - line_height( "line-height", 1.25 ), // SPILengthOrNormal + line_height( "line-height", 125 ), // SPILengthOrNormal font_family( "font-family", "sans-serif" ), // SPIString w/default font(), // SPIFont font_specification( "-inkscape-font-specification" ), // SPIString @@ -1957,7 +1957,7 @@ sp_css_attr_scale(SPCSSAttr *css, double ex) sp_css_attr_scale_property_single(css, "kerning", ex); sp_css_attr_scale_property_single(css, "letter-spacing", ex); sp_css_attr_scale_property_single(css, "word-spacing", ex); - sp_css_attr_scale_property_single(css, "line-height", ex, true); + //sp_css_attr_scale_property_single(css, "line-height", ex, true); return css; } -- cgit v1.2.3 From a714c688d60a3a62114591984f57f26cd41dbed9 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 18 Mar 2016 11:23:29 +0100 Subject: Reverting 14701. (bzr r14716.1.2) --- src/style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 99beaed22..35138d25b 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -113,7 +113,7 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : font_weight( "font-weight", enum_font_weight, SP_CSS_FONT_WEIGHT_NORMAL, SP_CSS_FONT_WEIGHT_400 ), font_stretch( "font-stretch", enum_font_stretch, SP_CSS_FONT_STRETCH_NORMAL ), font_size(), - line_height( "line-height", 125 ), // SPILengthOrNormal + line_height( "line-height", 1.25 ), // SPILengthOrNormal font_family( "font-family", "sans-serif" ), // SPIString w/default font(), // SPIFont font_specification( "-inkscape-font-specification" ), // SPIString @@ -1957,7 +1957,7 @@ sp_css_attr_scale(SPCSSAttr *css, double ex) sp_css_attr_scale_property_single(css, "kerning", ex); sp_css_attr_scale_property_single(css, "letter-spacing", ex); sp_css_attr_scale_property_single(css, "word-spacing", ex); - //sp_css_attr_scale_property_single(css, "line-height", ex, true); + sp_css_attr_scale_property_single(css, "line-height", ex, true); return css; } -- cgit v1.2.3 From 4cce40a79ab973a3609cd5ee7666673bc2337fef Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 22 Mar 2016 14:56:36 +0100 Subject: Add line-height unit selector to text toolbar. Remove 'm' and 'ft' non-CSS lengths. (bzr r14716.1.3) --- src/style.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 35138d25b..1f98a50a3 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -1510,7 +1510,8 @@ gchar const * sp_style_get_css_unit_string(int unit) { // specify px by default, see inkscape bug 1221626, mozilla bug 234789 - + // This is a problematic fix as some properties (e.g. 'line-height') have + // different behaviour if there is no unit. switch (unit) { case SP_CSS_UNIT_NONE: return "px"; -- cgit v1.2.3 From fd1988584d74008516463f33fc98e819ab838f9b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 30 Mar 2016 20:58:46 +0200 Subject: Finish fixing bug 156221 ('line-height' with non-px scaling). (bzr r14753) --- src/style.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 1f98a50a3..c24818f2a 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -1900,8 +1900,9 @@ sp_css_attr_scale_property_single(SPCSSAttr *css, gchar const *property, if (w == units) {// nothing converted, non-numeric value return; } - if (only_with_units && (units == NULL || *units == '\0' || *units == '%')) { + if (only_with_units && (units == NULL || *units == '\0' || *units == '%' || *units == 'e')) { // only_with_units, but no units found, so do nothing. + // 'e' matches 'em' or 'ex' return; } Inkscape::CSSOStringStream os; -- cgit v1.2.3