summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-02-28 14:08:12 +0000
committertavmjong-free <tavmjong@free.fr>2014-02-28 14:08:12 +0000
commite32a54537e44cda5d90aa8b26d7fde87bff0ca58 (patch)
treecf80809c84ee4881da84af6f7f497dbe384add26 /src
parentProperly identify an embedded SVG. (diff)
downloadinkscape-e32a54537e44cda5d90aa8b26d7fde87bff0ca58.tar.gz
inkscape-e32a54537e44cda5d90aa8b26d7fde87bff0ca58.zip
Embedded SVG's cannot be transformed.
(bzr r13076)
Diffstat (limited to 'src')
-rw-r--r--src/selection-chemistry.cpp7
-rw-r--r--src/seltrans.cpp6
2 files changed, 13 insertions, 0 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 821d078d1..76be086a2 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1497,6 +1497,13 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons
for (GSList const *l = selection->itemList(); l != NULL; l = l->next) {
SPItem *item = SP_ITEM(l->data);
+ if( SP_IS_ROOT(item) ) {
+ // An SVG element cannot have a transform. We could change 'x' and 'y' in response
+ // to a translation... but leave that for another day.
+ selection->desktop()->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot transform an embedded SVG."));
+ break;
+ }
+
Geom::Point old_center(0,0);
if (set_i2d && item->isCenterSet())
old_center = item->getCenter();
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 78d9958c4..a55bc3c0d 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -29,11 +29,13 @@
#include "desktop-handles.h"
#include "desktop-style.h"
#include "knot.h"
+#include "message-stack.h"
#include "snap.h"
#include "selection.h"
#include "ui/tools/select-tool.h"
#include "sp-item.h"
#include "sp-item-transform.h"
+#include "sp-root.h"
#include "seltrans-handles.h"
#include "seltrans.h"
#include "selection-chemistry.h"
@@ -381,6 +383,10 @@ void Inkscape::SelTrans::transform(Geom::Affine const &rel_affine, Geom::Point c
// update the content
for (unsigned i = 0; i < _items.size(); i++) {
SPItem &item = *_items[i];
+ if( SP_IS_ROOT(&item) ) {
+ _desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot transform an embedded SVG."));
+ break;
+ }
Geom::Affine const &prev_transform = _items_affines[i];
item.set_i2d_affine(prev_transform * affine);
}