summaryrefslogtreecommitdiffstats
path: root/src/helper
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-04-03 17:07:50 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-04-03 17:07:50 +0000
commit02da648c4667a300a9727ee44c11a4349bb2bb98 (patch)
tree16ef336cc6e8a15cf645f77d7c441a045e63671b /src/helper
parentA few small fixes/clarifications for Gaussian blur. (diff)
parentFix grid extension (diff)
downloadinkscape-02da648c4667a300a9727ee44c11a4349bb2bb98.tar.gz
inkscape-02da648c4667a300a9727ee44c11a4349bb2bb98.zip
Change desktop coordinate system to match SVG (LP #170049)
Fixed bugs: - https://launchpad.net/bugs/170049 (bzr r9288)
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/pixbuf-ops.cpp2
-rw-r--r--src/helper/png-write.cpp21
2 files changed, 4 insertions, 19 deletions
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp
index 3be63aa68..c26d55b8b 100644
--- a/src/helper/pixbuf-ops.cpp
+++ b/src/helper/pixbuf-ops.cpp
@@ -113,7 +113,7 @@ sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/,
double padding = 1.0;
Geom::Point origin(screen.min()[Geom::X],
- sp_document_height(doc) - screen[Geom::Y].extent() - screen.min()[Geom::Y]);
+ 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));
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp
index b1c135db0..8eb9e27bf 100644
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
@@ -424,24 +424,9 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
sp_document_ensure_up_to_date(doc);
- /* Calculate translation by transforming to document coordinates (flipping Y)*/
- Geom::Point translation = Geom::Point(-area[Geom::X][0], area[Geom::Y][1] - sp_document_height(doc));
-
- /* This calculation is only valid when assumed that (x0,y0)= area.corner(0) and (x1,y1) = area.corner(2)
- * 1) a[0] * x0 + a[2] * y1 + a[4] = 0.0
- * 2) a[1] * x0 + a[3] * y1 + a[5] = 0.0
- * 3) a[0] * x1 + a[2] * y1 + a[4] = width
- * 4) a[1] * x0 + a[3] * y0 + a[5] = height
- * 5) a[1] = 0.0;
- * 6) a[2] = 0.0;
- *
- * (1,3) a[0] * x1 - a[0] * x0 = width
- * a[0] = width / (x1 - x0)
- * (2,4) a[3] * y0 - a[3] * y1 = height
- * a[3] = height / (y0 - y1)
- * (1) a[4] = -a[0] * x0
- * (2) a[5] = -a[3] * y1
- */
+ /* Calculate translation */
+ Geom::Point translation = Geom::Point(-area[Geom::X][0], -area[Geom::Y][0]);
+
Geom::Matrix const affine(Geom::Translate(translation)
* Geom::Scale(width / area.width(),