summaryrefslogtreecommitdiffstats
path: root/src/helper
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-09-20 17:43:57 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-09-20 17:43:57 +0000
commit0a836d1870bb87d5be3e4d900718f903371c8e56 (patch)
tree7d218dc0e9d81e2f7d3eddcefad9640769dc89b3 /src/helper
parentCompact of SVG icons whith the help of ~suv and Martin Owens (diff)
parentMerge Google Summer of Code unit improvement. (diff)
downloadinkscape-0a836d1870bb87d5be3e4d900718f903371c8e56.tar.gz
inkscape-0a836d1870bb87d5be3e4d900718f903371c8e56.zip
Update to trunk
(bzr r11950.1.146)
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