summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/object/sp-text.cpp9
-rw-r--r--src/ui/shape-editor-knotholders.cpp2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp
index 2ab4f96a3..91ca65170 100644
--- a/src/object/sp-text.cpp
+++ b/src/object/sp-text.cpp
@@ -166,7 +166,7 @@ void SPText::update(SPCtx *ctx, guint flags) {
attributes.update( em, ex, w, h );
// Set inline_size computed value if necessary (i.e. if unit is %).
- if (style->inline_size.set) {
+ if (has_inline_size()) {
if (style->inline_size.unit == SP_CSS_UNIT_PERCENT) {
if (is_horizontal()) {
style->inline_size.computed = style->inline_size.value * ictx->viewport.width();
@@ -554,7 +554,7 @@ void SPText::_buildLayoutInit()
}
}
- } else if (style->inline_size.set) {
+ } else if (has_inline_size()) {
layout.wrap_mode = Inkscape::Text::Layout::WRAP_INLINE_SIZE;
@@ -922,7 +922,8 @@ bool SPText::is_horizontal() const
bool SPText::has_inline_size() const
{
- return (style->inline_size.set);
+ // If inline size is '0' it is as if it is not set.
+ return (style->inline_size.set && style->inline_size.value != 0);
}
bool SPText::has_shape_inside() const
@@ -936,7 +937,7 @@ Geom::OptRect SPText::get_frame()
Geom::OptRect opt_frame;
Geom::Rect frame;
- if (style->inline_size.set) {
+ if (has_inline_size()) {
double inline_size = style->inline_size.computed;
unsigned mode = style->writing_mode.computed;
unsigned anchor = style->text_anchor.computed;
diff --git a/src/ui/shape-editor-knotholders.cpp b/src/ui/shape-editor-knotholders.cpp
index 02add372f..a2aa9919a 100644
--- a/src/ui/shape-editor-knotholders.cpp
+++ b/src/ui/shape-editor-knotholders.cpp
@@ -1693,7 +1693,7 @@ TextKnotHolderEntityInlineSize::knot_get() const
Geom::Point p(text->attributes.firstXY());
- if (text->style->inline_size.set) {
+ if (text->has_inline_size()) {
// SVG 2 'inline-size'
// Keep handle at end of text line.