summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/document.cpp b/src/document.cpp
index b3d606417..2832536af 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -716,11 +716,9 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins)
double const old_height = getHeight().value("px");
Inkscape::Util::Unit const *nv_units = unit_table.getUnit("px");
+ if (root->height.unit)
+ nv_units = unit_table.getUnit(root->height.unit);
SPNamedView *nv = sp_document_namedview(this, NULL);
- if (nv != NULL) {
- if (nv->getAttribute("units"))
- nv_units = unit_table.getUnit(nv->getAttribute("units"));
- }
/* in px */
double margin_top = 0.0;