summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-08-28 03:32:14 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-08-28 03:32:14 +0000
commit3bfb610bb7719d49821fe5381ae449789c3cb968 (patch)
treec6c221e0c7bfcc6399ee4aee360b7b1d4de3f896 /src/main.cpp
parentUse Quantity comparisons in PageSizer. (diff)
downloadinkscape-3bfb610bb7719d49821fe5381ae449789c3cb968.tar.gz
inkscape-3bfb610bb7719d49821fe5381ae449789c3cb968.zip
Improve code readability.
(bzr r12475.1.9)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 29f431aa8..dccf70889 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1536,7 +1536,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 * Inkscape::Util::Quantity::convert(1, "in", "px") / area.width();
+ dpi = (gdouble) Inkscape::Util::Quantity::convert(width, "in", "px") / area.width();
}
if (sp_export_height) {
@@ -1546,15 +1546,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 * Inkscape::Util::Quantity::convert(1, "in", "px") / area.height();
+ dpi = (gdouble) Inkscape::Util::Quantity::convert(height, "in", "px") / area.height();
}
if (!sp_export_width) {
- width = (unsigned long int) (area.width() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5);
+ width = (unsigned long int) (Inkscape::Util::Quantity::convert(area.width(), "px", "in") * dpi + 0.5);
}
if (!sp_export_height) {
- height = (unsigned long int) (area.height() * dpi / Inkscape::Util::Quantity::convert(1, "in", "px") + 0.5);
+ height = (unsigned long int) (Inkscape::Util::Quantity::convert(area.height(), "px", "in") * dpi + 0.5);
}
guint32 bgcolor = 0x00000000;