summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a5ca7d8)
raw | patch | inline | side by side (parent: a5ca7d8)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 29 Jul 2007 05:27:33 +0000 (05:27 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 29 Jul 2007 05:27:33 +0000 (05:27 +0000) |
src/sp-text.cpp | patch | blob | history |
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index d1105ac2065987e817fa3a709e2c3e17558ac516..cc575d99f7dc473e042a4364334066737590eb22 100644 (file)
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
if (!tspan->attributes.singleXYCoordinates()) continue;
Inkscape::Text::Layout::iterator iter = layout.sourceToIterator(tspan);
NR::Point anchor_point = layout.chunkAnchorPoint(iter);
- sp_repr_set_svg_double(SP_OBJECT_REPR(tspan), "x", anchor_point[NR::X]);
- sp_repr_set_svg_double(SP_OBJECT_REPR(tspan), "y", anchor_point[NR::Y]);
+ tspan->attributes.setFirstXY(anchor_point);
}
}
return point;
}
+void TextTagAttributes::setFirstXY(NR::Point &point)
+{
+ SVGLength zero_length;
+ zero_length = 0.0;
+
+ if (attributes.x.empty())
+ attributes.x.resize(1, zero_length);
+ if (attributes.y.empty())
+ attributes.y.resize(1, zero_length);
+ attributes.x[0].computed = point[NR::X];
+ attributes.y[0].computed = point[NR::Y];
+}
+
void TextTagAttributes::mergeInto(Inkscape::Text::Layout::OptionalTextTagAttrs *output, Inkscape::Text::Layout::OptionalTextTagAttrs const &parent_attrs, unsigned parent_attrs_offset, bool copy_xy, bool copy_dxdyrotate) const
{
mergeSingleAttribute(&output->x, parent_attrs.x, parent_attrs_offset, copy_xy ? &attributes.x : NULL);