summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dbd57ba)
raw | patch | inline | side by side (parent: dbd57ba)
author | ozmikepittman <ozmikepittman@users.sourceforge.net> | |
Sun, 11 May 2008 03:37:28 +0000 (03:37 +0000) | ||
committer | ozmikepittman <ozmikepittman@users.sourceforge.net> | |
Sun, 11 May 2008 03:37:28 +0000 (03:37 +0000) |
src/document.cpp | patch | blob | history |
diff --git a/src/document.cpp b/src/document.cpp
index 92aad942d7687e7f8d24cad35a25712962774d8b..d0792ab8a7c5c01931638528d1088cd38f43b417 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
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
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;
}
/**