diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-09-12 14:43:47 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-09-12 14:43:47 +0000 |
| commit | 1fa0c72b664afa4803dffd463ed11ce01632ab76 (patch) | |
| tree | c1f746d4e8f7a5d65541cf6c05d3cdc79b3f9c10 /src/helper/pixbuf-ops.cpp | |
| parent | Fix preferences crash (diff) | |
| download | inkscape-1fa0c72b664afa4803dffd463ed11ce01632ab76.tar.gz inkscape-1fa0c72b664afa4803dffd463ed11ce01632ab76.zip | |
New option to invert y-axis
Replaces all hard coded or implicit desktop coordinate usage with
doc2dt multiplication.
New global preference: Interface > Origin at upper left
https://bugs.launchpad.net/inkscape/+bug/170049
Diffstat (limited to 'src/helper/pixbuf-ops.cpp')
| -rw-r--r-- | src/helper/pixbuf-ops.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp index a79efdbdd..93ea8bc98 100644 --- a/src/helper/pixbuf-ops.cpp +++ b/src/helper/pixbuf-ops.cpp @@ -27,6 +27,7 @@ #include "object/sp-defs.h" #include "object/sp-use.h" #include "util/units.h" +#include "inkscape.h" #include "helper/pixbuf-ops.h" @@ -111,13 +112,7 @@ Inkscape::Pixbuf *sp_generate_internal_bitmap(SPDocument *doc, gchar const */*fi Geom::Rect screen=Geom::Rect(Geom::Point(x0,y0), Geom::Point(x1, y1)); - double padding = 1.0; - - Geom::Point origin(screen.min()[Geom::X], - 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::Point origin = screen.min() * SP_ACTIVE_DESKTOP->doc2dt(); 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); |
