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/object/sp-image.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/object/sp-image.cpp')
| -rw-r--r-- | src/object/sp-image.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/object/sp-image.cpp b/src/object/sp-image.cpp index 9c2fe9ac3..65643c701 100644 --- a/src/object/sp-image.cpp +++ b/src/object/sp-image.cpp @@ -73,7 +73,7 @@ static void sp_image_set_curve(SPImage *image); static Inkscape::Pixbuf *sp_image_repr_read_image(gchar const *href, gchar const *absref, gchar const *base, - char const *svgdpi); + double svgdpi = 0); static void sp_image_update_arenaitem (SPImage *img, Inkscape::DrawingImage *ai); static void sp_image_update_canvas_image (SPImage *image); @@ -338,11 +338,11 @@ void SPImage::update(SPCtx *ctx, unsigned int flags) { this->pixbuf = nullptr; if (this->href) { Inkscape::Pixbuf *pixbuf = nullptr; - const gchar *svgdpi = this->getRepr()->attribute("inkscape:svg-dpi"); - if (!svgdpi) { - svgdpi = "96"; + double svgdpi = 96; + if (this->getRepr()->attribute("inkscape:svg-dpi")) { + svgdpi = atof(this->getRepr()->attribute("inkscape:svg-dpi")); } - this->dpi = atof(svgdpi); + this->dpi = svgdpi; pixbuf = sp_image_repr_read_image(this->getRepr()->attribute("xlink:href"), this->getRepr()->attribute("sodipodi:absref"), doc->getBase(), svgdpi); @@ -545,9 +545,9 @@ gchar* SPImage::description() const { this->document) { Inkscape::Pixbuf * pb = nullptr; - const gchar *svgdpi = this->getRepr()->attribute("inkscape:svg-dpi"); - if (!svgdpi) { - svgdpi = "96"; + double svgdpi = 96; + if (this->getRepr()->attribute("inkscape:svg-dpi")) { + svgdpi = atof(this->getRepr()->attribute("inkscape:svg-dpi")); } pb = sp_image_repr_read_image(this->getRepr()->attribute("xlink:href"), this->getRepr()->attribute("sodipodi:absref"), this->document->getBase(), svgdpi); @@ -573,7 +573,7 @@ Inkscape::DrawingItem* SPImage::show(Inkscape::Drawing &drawing, unsigned int /* return ai; } -Inkscape::Pixbuf *sp_image_repr_read_image(gchar const *href, gchar const *absref, gchar const *base, char const *svgdpi) +Inkscape::Pixbuf *sp_image_repr_read_image(gchar const *href, gchar const *absref, gchar const *base, double svgdpi) { Inkscape::Pixbuf *inkpb = nullptr; |
