diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2019-09-16 12:03:48 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2019-09-16 12:03:48 +0000 |
| commit | 42ceb86a187d0e0714c67a420b84726fda5fae91 (patch) | |
| tree | 79a981c75fafb06697ae3ee2c01e9ee5e2074fd0 /src | |
| parent | Update hr.po (diff) | |
| download | inkscape-42ceb86a187d0e0714c67a420b84726fda5fae91.tar.gz inkscape-42ceb86a187d0e0714c67a420b84726fda5fae91.zip | |
Allow paste on flowbox at same sice of origin, also improve creation to get rid of transforms on origin
Diffstat (limited to 'src')
| -rw-r--r-- | src/object/sp-flowtext.cpp | 8 | ||||
| -rw-r--r-- | src/ui/clipboard.cpp | 7 | ||||
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 9 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/object/sp-flowtext.cpp b/src/object/sp-flowtext.cpp index 5d46c7b1e..05e06cff5 100644 --- a/src/object/sp-flowtext.cpp +++ b/src/object/sp-flowtext.cpp @@ -666,7 +666,10 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0, Geom::Coord const w = x1 - x0; Geom::Coord const h = y1 - y0; + SPItem *item = dynamic_cast<SPItem *>(desktop->currentLayer()); + g_assert(item != nullptr); rect->setPosition(x0, y0, w, h); + rect->doWriteTransform(item->i2doc_affine().inverse(), nullptr, true); rect->updateRepr(); Inkscape::XML::Node *para_repr = xml_doc->createElement("svg:flowPara"); @@ -682,11 +685,6 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0, Inkscape::GC::release(para_repr); Inkscape::GC::release(rect_repr); - - SPItem *item = dynamic_cast<SPItem *>(desktop->currentLayer()); - g_assert(item != nullptr); - ft_item->transform = item->i2doc_affine().inverse(); - return ft_item; } diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 078dfc125..fb7bebc39 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -1093,7 +1093,8 @@ bool ClipboardManagerImpl::_pasteText(SPDesktop *desktop) if (textitem) { textitem->hide_shape_inside(); } - SPCSSAttr *css = take_style_from_item(tc->text); + // we realy only want to inherit container style + /* SPCSSAttr *css = take_style_from_item(tc->text); for (int i = 0; i < nr_blocks; ++i) { gchar const *w = sp_repr_css_property(css, "font-size", "0px"); @@ -1102,7 +1103,7 @@ bool ClipboardManagerImpl::_pasteText(SPDesktop *desktop) if (w && strcmp(w, "0px") != 0) { sp_repr_css_set_property(te_selected_style[i], "font-size", w); } - } + } */ for (unsigned int i = 0; i < text.length(); ++i) it.prevCharacter(); @@ -1114,7 +1115,7 @@ bool ClipboardManagerImpl::_pasteText(SPDesktop *desktop) for (unsigned int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j) it_next.nextCharacter(); - sp_te_apply_style(tc->text, it, it_next, te_selected_style[i]); + // sp_te_apply_style(tc->text, it, it_next, te_selected_style[i]); te_update_layout_now_recursive(tc->text); for (unsigned int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j) it.nextCharacter(); diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index a9a66d64f..161b20aa2 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -685,7 +685,14 @@ bool TextTool::root_handler(GdkEvent* event) { /* Set style */ sp_desktop_apply_style_tool(desktop, ft->getRepr(), "/tools/text", true); - + SPCSSAttr *css = sp_repr_css_attr(ft->getRepr(), "style" ); + Geom::Affine const local(ft->i2doc_affine()); + double const ex(local.descrim()); + if ( (ex != 0.0) && (ex != 1.0) ) { + sp_css_attr_scale(css, 1/ex); + } + ft->setCSS(css,"style"); + sp_repr_css_attr_unref(css); ft->updateRepr(); desktop->getSelection()->set(ft); |
