summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorMike Pittman <thepittos@yahoo.com.au>2008-05-11 03:37:28 +0000
committerozmikepittman <ozmikepittman@users.sourceforge.net>2008-05-11 03:37:28 +0000
commit1aa0b0100037a2fcc0e9b820935420209740db33 (patch)
tree870a01a2b529fac99dc2a9581c9f30f0d15c1b93 /src/document.cpp
parenthopefully this correctly adds gsl dependency. can't check! (diff)
downloadinkscape-1aa0b0100037a2fcc0e9b820935420209740db33.tar.gz
inkscape-1aa0b0100037a2fcc0e9b820935420209740db33.zip
Fix incorrect preview problems on Win32 with native dialogues - see LP #229045
(bzr r5651)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 92aad942d..d0792ab8a 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -471,7 +471,11 @@ gdouble sp_document_width(SPDocument *document)
g_return_val_if_fail(document->priv != NULL, 0.0);
g_return_val_if_fail(document->root != NULL, 0.0);
- return SP_ROOT(document->root)->width.computed;
+ SPRoot *root = SP_ROOT(document->root);
+
+ if (root->width.unit == SVGLength::PERCENT && root->viewBox_set)
+ return root->viewBox.x1 - root->viewBox.x0;
+ return root->width.computed;
}
void
@@ -525,7 +529,11 @@ gdouble sp_document_height(SPDocument *document)
g_return_val_if_fail(document->priv != NULL, 0.0);
g_return_val_if_fail(document->root != NULL, 0.0);
- return SP_ROOT(document->root)->height.computed;
+ SPRoot *root = SP_ROOT(document->root);
+
+ if (root->height.unit == SVGLength::PERCENT && root->viewBox_set)
+ return root->viewBox.y1 - root->viewBox.y0;
+ return root->height.computed;
}
/**