From b5fa05c9c0ba0c023d6fc72bfe3a7f3a5ddd4c3d Mon Sep 17 00:00:00 2001 From: Andrius Ramanauskas Date: Wed, 3 May 2006 04:05:57 +0000 Subject: Fix for Bug-1480247 (wrong page size when switching portrait-landscape) (bzr r699) --- src/ui/widget/page-sizer.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/ui/widget/page-sizer.cpp') diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 4fb77bbdd..5211ee9a1 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -296,13 +296,16 @@ void PageSizer::setDoc (double w, double h) { setDim (w, h); - if (!SP_ACTIVE_DESKTOP || _wr->isUpdating()) - return; - SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); - sp_document_set_width (doc, _rusw.getSU()->getValue("px"), &_px_unit); - sp_document_set_height (doc, _rush.getSU()->getValue("px"), &_px_unit); - sp_document_done (doc); + if (SP_ACTIVE_DESKTOP && !_wr->isUpdating()) { + SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); + Unit const& unit = _rum._sel->getUnit(); + sp_document_set_width (doc, w / unit.factor, &_px_unit); + sp_document_set_height (doc, h / unit.factor, &_px_unit); + sp_document_done (doc); + } + + setDim (w, h); } /** @@ -349,6 +352,8 @@ PageSizer::fire_fit_canvas_to_selection_or_drawing() { void PageSizer::on_portrait() { + if (!_rb_port->get_active()) + return; double w = _rusw.getSU()->getValue ("px"); double h = _rush.getSU()->getValue ("px"); if (hget_active()) + return; double w = _rusw.getSU()->getValue ("px"); double h = _rush.getSU()->getValue ("px"); if (w