diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-07-29 05:27:33 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-07-29 05:27:33 +0000 |
| commit | 3f9fa558d453b18cce975cfa38e55271fb6a1e14 (patch) | |
| tree | cd8205e2bb583e851cf81adfa44366b5e657d828 /src | |
| parent | add setter for first x/y pair (diff) | |
| download | inkscape-3f9fa558d453b18cce975cfa38e55271fb6a1e14.tar.gz inkscape-3f9fa558d453b18cce975cfa38e55271fb6a1e14.zip | |
now this is the correct way to avoid nested updates, instead of the hack i recently removed from sptspan set method
(bzr r3338)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-text.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/sp-text.cpp b/src/sp-text.cpp index d1105ac20..cc575d99f 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -587,8 +587,7 @@ void SPText::rebuildLayout() 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); } } @@ -725,6 +724,19 @@ NR::Point TextTagAttributes::firstXY() const 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); |
