summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
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/document.cpp
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/document.cpp')
-rw-r--r--src/document.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 101c54e30..f137ba60d 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -662,7 +662,6 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins)
double const w = rect.width();
double const h = rect.height();
- double const old_height = sp_document_height(this);
SPUnit const &px(sp_unit_get_by_id(SP_UNIT_PX));
/* in px */
@@ -696,16 +695,14 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins)
}
Geom::Rect const rect_with_margins(
- rect.min() - Geom::Point(margin_left, margin_bottom),
- rect.max() + Geom::Point(margin_right, margin_top));
+ rect.min() - Geom::Point(margin_left, margin_top),
+ rect.max() + Geom::Point(margin_right, margin_bottom));
sp_document_set_width(this, rect_with_margins.width(), &px);
sp_document_set_height(this, rect_with_margins.height(), &px);
- Geom::Translate const tr(
- Geom::Point(0, old_height - rect_with_margins.height())
- - to_2geom(rect_with_margins.min()));
+ Geom::Translate const tr(-to_2geom(rect_with_margins.min()));
SP_GROUP(root)->translateChildItems(tr);
if(nv) {
@@ -713,7 +710,7 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins)
nv->translateGuides(tr2);
// update the viewport so the drawing appears to stay where it was
- nv->scrollAllDesktops(-tr2[0], tr2[1], false);
+ nv->scrollAllDesktops(-tr2[0], -tr2[1], false);
}
}