diff --git a/src/document.cpp b/src/document.cpp
index f137ba60dab668fc43d0dd725db569fb2786a3f7..3c9f7e5edc2a06272324aa8b422cae78914bbad3 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
base(0),
name(0),
priv(0), // reset in ctor
- actionkey(0),
+ actionkey(),
modified_id(0),
rerouting_handler_id(0),
profileManager(0), // deferred until after other initialization
inkscape_unref();
keepalive = FALSE;
}
-
//delete this->_whiteboard_session_manager;
}
void SPDocument::reset_key (void */*dummy*/)
{
- actionkey = NULL;
+ actionkey.clear();
}
SPDocument *
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 */
margin_units = sp_unit_get_by_abbreviation(units_abbr);
}
if (margin_units == NULL) {
- margin_units = &sp_unit_get_by_id(SP_UNIT_PX);
+ margin_units = &px;
}
margin_top = getMarginLength(nv_repr, "fit-margin-top",
margin_units, &px, w, h, false);
}
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) {
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);
}
}