From c239b8d513fae662a4e3be85f85efb794d98d83d Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Mon, 16 Sep 2019 16:41:18 +0200 Subject: Allow paste preserving new lines into a flowtext element --- src/object/sp-flowtext.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/object/sp-flowtext.cpp') diff --git a/src/object/sp-flowtext.cpp b/src/object/sp-flowtext.cpp index 05e06cff5..a488e208b 100644 --- a/src/object/sp-flowtext.cpp +++ b/src/object/sp-flowtext.cpp @@ -688,6 +688,26 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0, return ft_item; } +void SPFlowtext::fix_overflow_flowregion(bool inverse) +{ + SPObject *object = dynamic_cast(this); + SPFlowregion *flowregion = nullptr; + for (auto child : object->childList(false)) { + SPFlowregion *flowregion = dynamic_cast(child); + if (flowregion) { + object = dynamic_cast(flowregion); + for (auto childshapes : object->childList(false)) { + Geom::Scale scale = Geom::Scale(1000); //200? maybe find better way to fix overglow issue removing new lines... + if (inverse) { + scale = scale.inverse(); + } + SP_SHAPE(childshapes)->doWriteTransform(scale, nullptr, true); + } + break; + } + } +} + Geom::Affine SPFlowtext::set_transform (Geom::Affine const &xform) { if ((this->_optimizeScaledText && !xform.withoutTranslation().isNonzeroUniformScale()) -- cgit v1.2.3