From: ozmikepittman Date: Sun, 11 May 2008 03:37:28 +0000 (+0000) Subject: Fix incorrect preview problems on Win32 with native dialogues - see LP #229045 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a562dcc89ca7185e77a03ff23aa1026b9b8ecd37;p=inkscape.git Fix incorrect preview problems on Win32 with native dialogues - see LP #229045 --- 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; } /**