diff options
| author | Alvin Penner <penner@vaxxine.com> | 2014-11-15 12:52:51 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2014-11-15 12:52:51 +0000 |
| commit | 510c80b1b2d9a4ee700bd152d320c6963bccd358 (patch) | |
| tree | 463c0831d3dd885ba267be279439b8df9f7c381e /src | |
| parent | Add inverse subdivision chamfer to fillet chamfer LPE, feature sugested by Iv... (diff) | |
| download | inkscape-510c80b1b2d9a4ee700bd152d320c6963bccd358.tar.gz inkscape-510c80b1b2d9a4ee700bd152d320c6963bccd358.zip | |
scale symbols when changing document units (Bug 1365451)
Fixed bugs:
- https://launchpad.net/bugs/1365451
(bzr r13709)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-item-group.cpp | 9 | ||||
| -rw-r--r-- | src/ui/clipboard.cpp | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 613ace5c1..992bca631 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -662,8 +662,13 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bo { if ( hasChildren() ) { for (SPObject *o = firstChild() ; o ; o = o->getNext() ) { - SPItem *item = dynamic_cast<SPItem *>(o); - if ( item ) { + if ( SPDefs *defs = dynamic_cast<SPDefs *>(o) ) { // select symbols from defs, ignore clips, masks, patterns + for (SPObject *defschild = defs->firstChild() ; defschild ; defschild = defschild->getNext() ) { + SPGroup *defsgroup = dynamic_cast<SPGroup *>(defschild); + if (defsgroup) + defsgroup->scaleChildItemsRec(sc, p, false); + } + } else if ( SPItem *item = dynamic_cast<SPItem *>(o) ) { SPGroup *group = dynamic_cast<SPGroup *>(item); if (group && !dynamic_cast<SPBox3D *>(item)) { /* Using recursion breaks clipping because transforms are applied diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 931a295d8..153ed9830 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -330,6 +330,13 @@ void ClipboardManagerImpl::copySymbol(Inkscape::XML::Node* symbol, gchar const* use->setAttribute("xlink:href", id.c_str() ); // Set a default style in <use> rather than <symbol> so it can be changed. use->setAttribute("style", style ); + + Inkscape::XML::Node *nv_repr = sp_desktop_namedview(inkscape_active_desktop())->getRepr(); + gdouble scale_units = Inkscape::Util::Quantity::convert(1, nv_repr->attribute("inkscape:document-units"), "px"); + gchar *transform_str = sp_svg_transform_write(Geom::Scale(scale_units, scale_units)); + use->setAttribute("transform", transform_str); + g_free(transform_str); + _root->appendChild(use); // This min and max sets offsets, we don't have any so set to zero. |
