diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-09-20 17:09:19 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-09-20 17:09:19 +0000 |
| commit | cf74f053a081f6f4b460da9cd72afaab23d54d13 (patch) | |
| tree | 427aa22ba3dcad9b55edb90522b5ab0208074e06 /src/sp-flowtext.cpp | |
| parent | Using inkscape compact settings to save the icons.svg file (diff) | |
| parent | Merge from trunk. (diff) | |
| download | inkscape-cf74f053a081f6f4b460da9cd72afaab23d54d13.tar.gz inkscape-cf74f053a081f6f4b460da9cd72afaab23d54d13.zip | |
Merge Google Summer of Code unit improvement.
(bzr r12554)
Diffstat (limited to 'src/sp-flowtext.cpp')
| -rw-r--r-- | src/sp-flowtext.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index 9d54ad92b..d46a644cf 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -28,6 +28,7 @@ #include "text-tag-attributes.h" #include "text-chemistry.h" #include "text-editing.h" +#include "sp-text.h" #include "livarot/Shape.h" @@ -648,6 +649,44 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0, return ft_item; } +Geom::Affine SPFlowtext::set_transform (Geom::Affine const &xform) +{ + if ((this->_optimizeScaledText && !xform.withoutTranslation().isNonzeroUniformScale()) + || (!this->_optimizeScaledText && !xform.isNonzeroUniformScale())) { + this->_optimizeScaledText = false; + return xform; + } + this->_optimizeScaledText = false; + + SPText *text = reinterpret_cast<SPText *>(this); + + double const ex = xform.descrim(); + if (ex == 0) { + return xform; + } + + Geom::Affine ret(xform); + ret[0] /= ex; + ret[1] /= ex; + ret[2] /= ex; + ret[3] /= ex; + + // Adjust font size + text->_adjustFontsizeRecursive (this, ex); + + // Adjust stroke width + this->adjust_stroke_width_recursive (ex); + + // Adjust pattern fill + this->adjust_pattern(xform * ret.inverse()); + + // Adjust gradient fill + this->adjust_gradient(xform * ret.inverse()); + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); + + return ret; +} /* Local Variables: |
