diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-04-06 14:11:54 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-04-06 14:11:54 +0000 |
| commit | 95a0c8412e84f5e0cc1d9a63fce2be75f9fa517e (patch) | |
| tree | 12ea4d0d88ad2a94be630f6634aef3b88460748f /src/document.cpp | |
| parent | Fixed use of dialogs in more than one window, and tile problem with selection... (diff) | |
| download | inkscape-95a0c8412e84f5e0cc1d9a63fce2be75f9fa517e.tar.gz inkscape-95a0c8412e84f5e0cc1d9a63fce2be75f9fa517e.zip | |
Revert the inverted coordinate system fix. 3D Boxes and guides
require an XML-level backwards compatibility mechanism to fix properly,
and it's too late in the 0.48 cycle to introduce it.
(bzr r9298)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/document.cpp b/src/document.cpp index aeafaf1f9..101c54e30 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -327,7 +327,7 @@ sp_document_create(Inkscape::XML::Document *rdoc, document->base = NULL; document->name = g_strdup(name); - sp_object_repr_build_tree(document, rroot); + document->root = sp_object_repr_build_tree(document, rroot); /* fixme: Not sure about this, but lets assume ::build updates */ rroot->setAttribute("inkscape:version", Inkscape::version_string); @@ -662,6 +662,7 @@ 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 */ @@ -695,14 +696,16 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) } Geom::Rect const rect_with_margins( - rect.min() - Geom::Point(margin_left, margin_top), - rect.max() + Geom::Point(margin_right, margin_bottom)); + rect.min() - Geom::Point(margin_left, margin_bottom), + rect.max() + Geom::Point(margin_right, margin_top)); sp_document_set_width(this, rect_with_margins.width(), &px); sp_document_set_height(this, rect_with_margins.height(), &px); - Geom::Translate const tr(-to_2geom(rect_with_margins.min())); + Geom::Translate const tr( + Geom::Point(0, old_height - rect_with_margins.height()) + - to_2geom(rect_with_margins.min())); SP_GROUP(root)->translateChildItems(tr); if(nv) { @@ -710,7 +713,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); } } |
