summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-08-30 21:35:42 +0000
committerMarkus Engel <markus.engel@tum.de>2013-08-30 21:35:42 +0000
commit8756c49b91fd4262b6770ac3b2f229209bdae96b (patch)
tree67ac89d7bc7c69e04e811324734dccafc07f33c9 /src/main.cpp
parentMerged from trunk (r12465). (diff)
parentMerge emf/wmf work (diff)
downloadinkscape-8756c49b91fd4262b6770ac3b2f229209bdae96b.tar.gz
inkscape-8756c49b91fd4262b6770ac3b2f229209bdae96b.zip
Merged from trunk (r12488).
(bzr r11608.1.120)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index b3070a95c..27346a230 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -68,7 +68,6 @@
#include "color.h"
#include "sp-item.h"
#include "sp-root.h"
-#include "unit-constants.h"
#include "svg/svg.h"
#include "svg/svg-color.h"
@@ -1523,7 +1522,7 @@ static int sp_do_export_png(SPDocument *doc)
// default dpi
if (dpi == 0.0) {
- dpi = PX_PER_IN;
+ dpi = Inkscape::Util::Quantity::convert(1, "in", "px");
}
unsigned long int width = 0;
@@ -1536,7 +1535,7 @@ static int sp_do_export_png(SPDocument *doc)
g_warning("Export width %lu out of range (1 - %lu). Nothing exported.", width, (unsigned long int)PNG_UINT_31_MAX);
return 1;
}
- dpi = (gdouble) width * PX_PER_IN / area.width();
+ dpi = (gdouble) width * Inkscape::Util::Quantity::convert(1, "in", "px") / area.width();
}
if (sp_export_height) {
@@ -1546,15 +1545,15 @@ static int sp_do_export_png(SPDocument *doc)
g_warning("Export height %lu out of range (1 - %lu). Nothing exported.", height, (unsigned long int)PNG_UINT_31_MAX);
return 1;
}
- dpi = (gdouble) height * PX_PER_IN / area.height();
+ dpi = (gdouble) height * Inkscape::Util::Quantity::convert(1, "in", "px") / area.height();
}
if (!sp_export_width) {
- width = (unsigned long int) (area.width() * dpi / PX_PER_IN + 0.5);
+ width = (unsigned long int) (area.width() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5);
}
if (!sp_export_height) {
- height = (unsigned long int) (area.height() * dpi / PX_PER_IN + 0.5);
+ height = (unsigned long int) (area.height() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5);
}
guint32 bgcolor = 0x00000000;