summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/gdkpixbuf-input.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-02-11 11:35:04 +0000
committertavmjong-free <tavmjong@free.fr>2014-02-11 11:35:04 +0000
commit1fcd3766d80f7ff8cc0fabc05c3923254ed86124 (patch)
treea8f0b08aad43dc79b27aa9cd3578778a2e2053ad /src/extension/internal/gdkpixbuf-input.cpp
parentFix parsing of preserveAspectRatio broken in r13016. (diff)
downloadinkscape-1fcd3766d80f7ff8cc0fabc05c3923254ed86124.tar.gz
inkscape-1fcd3766d80f7ff8cc0fabc05c3923254ed86124.zip
Set 'preserveAspectRatio' to 'none' when importing an image.
(bzr r13020)
Diffstat (limited to 'src/extension/internal/gdkpixbuf-input.cpp')
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index d7d692091..ec04b1dad 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -95,6 +95,11 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
Inkscape::XML::Node *image_node = xml_doc->createElement("svg:image");
sp_repr_set_svg_double(image_node, "width", width);
sp_repr_set_svg_double(image_node, "height", height);
+
+ // Added 11 Feb 2014 as we now honor "preserveAspectRatio" and this is
+ // what Inkscaper's expect.
+ image_node->setAttribute("preserveAspectRatio", "none");
+
if( scale.compare( "auto" ) != 0 ) {
SPCSSAttr *css = sp_repr_css_attr_new();
sp_repr_css_set_property(css, "image-rendering", scale.c_str());
@@ -122,6 +127,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
// Set viewBox if it doesn't exist
if (!doc->getRoot()->viewBox_set) {
+ std::cout << "Viewbox not set, setting" << std::endl;
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
}