summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/emf-print.cpp
diff options
context:
space:
mode:
authorDavid Mathog <mathog@caltech.edu>2014-02-22 09:03:23 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-02-22 09:03:23 +0000
commit12e03b939f58c6b6dc5495e0559fe47d7a73bb48 (patch)
tree266f2e2c34ea29a92bd5c4d33636668e14360317 /src/extension/internal/emf-print.cpp
parentSymbols dialog: update currentDesktop and currentDocument when document repla... (diff)
downloadinkscape-12e03b939f58c6b6dc5495e0559fe47d7a73bb48.tar.gz
inkscape-12e03b939f58c6b6dc5495e0559fe47d7a73bb48.zip
Fix 'preserveAspectRatio' attribute of bitmap images in EMF/WMF import/export (bug #1278645).
Fixed bugs: - https://launchpad.net/bugs/1278645 (bzr r13049)
Diffstat (limited to 'src/extension/internal/emf-print.cpp')
-rw-r--r--src/extension/internal/emf-print.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 6d5bb6f4b..c103100b3 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -1562,7 +1562,7 @@ unsigned int PrintEmf::image(
unsigned int w, /** width of bitmap */
unsigned int h, /** height of bitmap */
unsigned int rs, /** row stride (normally w*4) */
- Geom::Affine const &/*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */
+ Geom::Affine const &tf_rect, /** affine transform only used for defining location and size of rect, for all other tranforms, use the one from m_tr_stack */
SPStyle const *style) /** provides indirect link to image object */
{
double x1, y1, dw, dh;
@@ -1574,10 +1574,10 @@ unsigned int PrintEmf::image(
g_error("Fatal programming error in PrintEmf::image at EMRHEADER");
}
- x1 = atof(style->object->getAttribute("x"));
- y1 = atof(style->object->getAttribute("y"));
- dw = atof(style->object->getAttribute("width"));
- dh = atof(style->object->getAttribute("height"));
+ x1 = tf_rect[4];
+ y1 = tf_rect[5];
+ dw = ((double) w) * tf_rect[0];
+ dh = ((double) h) * tf_rect[3];
Geom::Point pLL(x1, y1);
Geom::Point pLL2 = pLL * tf; //location of LL corner in Inkscape coordinates