summaryrefslogtreecommitdiffstats
path: root/src/svg-view.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-08-27 16:32:55 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-08-27 16:32:55 +0000
commitf10048be170a45921ae8fc65ccd2588a9ad2897d (patch)
treec0abadf8d3b7ffb325061d797e5b8d9d8b2aefeb /src/svg-view.cpp
parentUse real world units for page sizes. (diff)
downloadinkscape-f10048be170a45921ae8fc65ccd2588a9ad2897d.tar.gz
inkscape-f10048be170a45921ae8fc65ccd2588a9ad2897d.zip
Added viewBox implement document unit support.
(bzr r12475.1.2)
Diffstat (limited to 'src/svg-view.cpp')
-rw-r--r--src/svg-view.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/svg-view.cpp b/src/svg-view.cpp
index 7559cbb24..f52608420 100644
--- a/src/svg-view.cpp
+++ b/src/svg-view.cpp
@@ -20,6 +20,7 @@
#include "sp-item.h"
#include "svg-view.h"
#include "sp-root.h"
+#include "util/units.h"
SPSVGView::SPSVGView(SPCanvasGroup *parent)
{
@@ -71,16 +72,16 @@ void SPSVGView::doRescale(bool event)
if (!doc()) {
return;
}
- if (doc()->getWidth () < 1e-9) {
+ if (doc()->getWidth().value("px") < 1e-9) {
return;
}
- if (doc()->getHeight () < 1e-9) {
+ if (doc()->getHeight().value("px") < 1e-9) {
return;
}
if (_rescale) {
- _hscale = _width / doc()->getWidth ();
- _vscale = _height / doc()->getHeight ();
+ _hscale = _width / doc()->getWidth().value("px");
+ _vscale = _height / doc()->getHeight().value("px");
if (_keepaspect) {
if (_hscale > _vscale) {
_hscale = _vscale;
@@ -95,8 +96,8 @@ void SPSVGView::doRescale(bool event)
}
if (event) {
- emitResized (doc()->getWidth () * _hscale,
- doc()->getHeight () * _vscale);
+ emitResized (doc()->getWidth().value("px") * _hscale,
+ doc()->getHeight().value("px") * _vscale);
}
}