diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2018-09-13 13:37:43 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2018-09-13 13:37:43 +0000 |
| commit | bda44805f365b0f4757a0f9c940d37d38ab4564b (patch) | |
| tree | aa42879fb9f10e7393fc8f457960b987ff06b953 /src/display/cairo-utils.cpp | |
| parent | Add per embed/linked SVG a DPI value (diff) | |
| download | inkscape-bda44805f365b0f4757a0f9c940d37d38ab4564b.tar.gz inkscape-bda44805f365b0f4757a0f9c940d37d38ab4564b.zip | |
Fix DPI wrong code pointed by Mc
Diffstat (limited to 'src/display/cairo-utils.cpp')
| -rw-r--r-- | src/display/cairo-utils.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp index 7279ac052..965645b15 100644 --- a/src/display/cairo-utils.cpp +++ b/src/display/cairo-utils.cpp @@ -207,7 +207,7 @@ Pixbuf::~Pixbuf() } } -Pixbuf *Pixbuf::create_from_data_uri(gchar const *uri_data, char const *svgdpi) +Pixbuf *Pixbuf::create_from_data_uri(gchar const *uri_data, double svgdpi) { Pixbuf *pixbuf = nullptr; @@ -311,8 +311,8 @@ Pixbuf *Pixbuf::create_from_data_uri(gchar const *uri_data, char const *svgdpi) } Inkscape::Preferences *prefs = Inkscape::Preferences::get(); double dpi = prefs->getDouble("/dialogs/import/defaultxdpi/value", 96.0); - if (svgdpi && atof(svgdpi) > 0) { - dpi = atof(svgdpi); + if (svgdpi && svgdpi > 0) { + dpi = svgdpi; } std::cout << dpi << "dpi" << std::endl; // Get the size of the document @@ -342,7 +342,7 @@ Pixbuf *Pixbuf::create_from_data_uri(gchar const *uri_data, char const *svgdpi) return pixbuf; } -Pixbuf *Pixbuf::create_from_file(std::string const &fn, char const *svgdpi) +Pixbuf *Pixbuf::create_from_file(std::string const &fn, double svgdpi) { Pixbuf *pb = nullptr; // test correctness of filename @@ -387,8 +387,8 @@ Pixbuf *Pixbuf::create_from_file(std::string const &fn, char const *svgdpi) } Inkscape::Preferences *prefs = Inkscape::Preferences::get(); double dpi = prefs->getDouble("/dialogs/import/defaultxdpi/value", 96.0); - if (svgdpi && atof(svgdpi) > 0) { - dpi = atof(svgdpi); + if (svgdpi && svgdpi > 0) { + dpi = svgdpi; } std::cout << dpi << "dpi" << std::endl; // Get the size of the document |
