summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2f3a7f)
raw | patch | inline | side by side (parent: a2f3a7f)
| author | knutux <knutux@users.sourceforge.net> | |
| Wed, 3 May 2006 04:05:57 +0000 (04:05 +0000) | ||
| committer | knutux <knutux@users.sourceforge.net> | |
| Wed, 3 May 2006 04:05:57 +0000 (04:05 +0000) |
| src/ui/widget/page-sizer.cpp | patch | blob | history |
index 4fb77bbdd4e4c427b51b6546913559dcbc283454..5211ee9a1388d38085770a1d90ffeb6150cae9cd 100644 (file)
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);
}
/**
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);
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);