diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-09-15 19:00:40 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-09-15 19:00:40 +0000 |
| commit | 803e249e999ab90caf2e3d61cc6782aa7dd3caba (patch) | |
| tree | ba1532a2eaea036d15f9566e65de38b1a3746397 /src/sp-item-group.cpp | |
| parent | Fix bug with tool handles during document unit change. (diff) | |
| download | inkscape-803e249e999ab90caf2e3d61cc6782aa7dd3caba.tar.gz inkscape-803e249e999ab90caf2e3d61cc6782aa7dd3caba.zip | |
Fix document unit change for transformed flow text and transformed text on path.
(bzr r12475.1.18)
Diffstat (limited to 'src/sp-item-group.cpp')
| -rw-r--r-- | src/sp-item-group.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index be62764c3..1b8af43e1 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -51,8 +51,8 @@ #include "sp-defs.h" #include "verbs.h" #include "layer-model.h" -#include "selection-chemistry.h" #include "sp-textpath.h" +#include "sp-flowtext.h" using Inkscape::DocumentUndo; @@ -585,18 +585,27 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p) old_center = item->getCenter(); } - if (SP_IS_TEXT_TEXTPATH(item) && item->transform.isIdentity()) { - if (item->transform.isIdentity()) { - SP_TEXT(item)->optimizeTextpathText(); - } else { - // TODO: transformed text on textpath - } + if (SP_IS_TEXT_TEXTPATH(item)) { + SP_TEXT(item)->optimizeTextpathText(); + } else if (SP_IS_FLOWTEXT(item)) { + SP_FLOWTEXT(item)->optimizeScaledText(); } else if (SP_IS_BOX3D(item)) { // Force recalculation from perspective box3d_position_set(SP_BOX3D(item)); } - if (SP_IS_USE(item)) { + if ((SP_IS_TEXT_TEXTPATH(item) || SP_IS_FLOWTEXT(item)) && !item->transform.isIdentity()) { + // Save and reset current transform + Geom::Affine tmp(item->transform); + item->transform = Geom::Affine(); + // Apply scale + item->set_i2d_affine(item->i2dt_affine() * sc); + item->doWriteTransform(item->getRepr(), item->transform, NULL, true); + // Scale translation and restore original transform + tmp[4] *= sc[0]; + tmp[5] *= sc[1]; + item->doWriteTransform(item->getRepr(), tmp, NULL, true); + } else if (SP_IS_USE(item)) { // calculate the matrix we need to apply to the clone // to cancel its induced transform from its original Geom::Affine move = final.inverse() * item->transform * final; |
