diff options
| author | Andrius Ramanauskas <knutux@gmail.com> | 2006-05-03 04:05:57 +0000 |
|---|---|---|
| committer | knutux <knutux@users.sourceforge.net> | 2006-05-03 04:05:57 +0000 |
| commit | b5fa05c9c0ba0c023d6fc72bfe3a7f3a5ddd4c3d (patch) | |
| tree | 54b83c71d0e0f81fcf716cfbe0174dab70f1b45c /src/ui/widget/page-sizer.cpp | |
| parent | small update of Lithuanian translation (diff) | |
| download | inkscape-b5fa05c9c0ba0c023d6fc72bfe3a7f3a5ddd4c3d.tar.gz inkscape-b5fa05c9c0ba0c023d6fc72bfe3a7f3a5ddd4c3d.zip | |
Fix for Bug-1480247 (wrong page size when switching portrait-landscape)
(bzr r699)
Diffstat (limited to 'src/ui/widget/page-sizer.cpp')
| -rw-r--r-- | src/ui/widget/page-sizer.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
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 (h<w) setDoc (h, w); @@ -357,6 +362,8 @@ PageSizer::on_portrait() void PageSizer::on_landscape() { + if (!_rb_land->get_active()) + return; double w = _rusw.getSU()->getValue ("px"); double h = _rush.getSU()->getValue ("px"); if (w<h) setDoc (h, w); |
