summaryrefslogtreecommitdiffstats
path: root/src/helper
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-09-20 17:09:19 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-09-20 17:09:19 +0000
commitcf74f053a081f6f4b460da9cd72afaab23d54d13 (patch)
tree427aa22ba3dcad9b55edb90522b5ab0208074e06 /src/helper
parentUsing inkscape compact settings to save the icons.svg file (diff)
parentMerge from trunk. (diff)
downloadinkscape-cf74f053a081f6f4b460da9cd72afaab23d54d13.tar.gz
inkscape-cf74f053a081f6f4b460da9cd72afaab23d54d13.zip
Merge Google Summer of Code unit improvement.
(bzr r12554)
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/pixbuf-ops.cpp4
-rw-r--r--src/helper/png-write.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp
index 8e611d197..cd4f539ec 100644
--- a/src/helper/pixbuf-ops.cpp
+++ b/src/helper/pixbuf-ops.cpp
@@ -115,12 +115,12 @@ Inkscape::Pixbuf *sp_generate_internal_bitmap(SPDocument *doc, gchar const */*fi
double padding = 1.0;
Geom::Point origin(screen.min()[Geom::X],
- doc->getHeight() - screen[Geom::Y].extent() - screen.min()[Geom::Y]);
+ doc->getHeight().value("px") - screen[Geom::Y].extent() - screen.min()[Geom::Y]);
origin[Geom::X] = origin[Geom::X] + (screen[Geom::X].extent() * ((1 - padding) / 2));
origin[Geom::Y] = origin[Geom::Y] + (screen[Geom::Y].extent() * ((1 - padding) / 2));
- Geom::Scale scale( (xdpi / Inkscape::Util::Quantity::convert(1, "in", "px")), (ydpi / Inkscape::Util::Quantity::convert(1, "in", "px")));
+ Geom::Scale scale(Inkscape::Util::Quantity::convert(xdpi, "px", "in"), Inkscape::Util::Quantity::convert(ydpi, "px", "in"));
Geom::Affine affine = scale * Geom::Translate(-origin * scale);
/* Create ArenaItems and set transform */
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp
index c43a207c8..b8b815b4c 100644
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
@@ -34,6 +34,7 @@
#include "preferences.h"
#include "rdf.h"
#include "display/cairo-utils.h"
+#include "util/units.h"
/* This is an example of how to use libpng to read and write PNG files.
* The file libpng.txt is much more verbose then this. If you have not
@@ -415,7 +416,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename,
doc->ensureUpToDate();
/* Calculate translation by transforming to document coordinates (flipping Y)*/
- Geom::Point translation = Geom::Point(-area[Geom::X][0], area[Geom::Y][1] - doc->getHeight());
+ Geom::Point translation = Geom::Point(-area[Geom::X][0], area[Geom::Y][1] - doc->getHeight().value("px"));
/* This calculation is only valid when assumed that (x0,y0)= area.corner(0) and (x1,y1) = area.corner(2)
* 1) a[0] * x0 + a[2] * y1 + a[4] = 0.0