From a562dcc89ca7185e77a03ff23aa1026b9b8ecd37 Mon Sep 17 00:00:00 2001 From: ozmikepittman Date: Sun, 11 May 2008 03:37:28 +0000 Subject: [PATCH] Fix incorrect preview problems on Win32 with native dialogues - see LP #229045 --- src/document.cpp | 12 ++++++++++-- 1 file 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; } /** -- 2.30.2