summaryrefslogtreecommitdiffstats
path: root/src/document.h
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-07-27 14:40:29 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-07-27 14:40:29 +0000
commit63203fb881bfce667a14b2bbb3ec2ee40a9adf77 (patch)
tree86f322f2330dd9bd2f6719ffd7fd828bc67e4356 /src/document.h
parentCrashfix for connectors avoid selected items (diff)
downloadinkscape-63203fb881bfce667a14b2bbb3ec2ee40a9adf77.tar.gz
inkscape-63203fb881bfce667a14b2bbb3ec2ee40a9adf77.zip
Make doc2dt a document property
Closes #340
Diffstat (limited to 'src/document.h')
-rw-r--r--src/document.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/document.h b/src/document.h
index 609d665bc..fd7e15fc5 100644
--- a/src/document.h
+++ b/src/document.h
@@ -29,6 +29,7 @@
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
+#include <2geom/affine.h>
#include <2geom/forward.h>
#include "3rdparty/libcroco/cr-cascade.h"
@@ -390,7 +391,22 @@ private:
sigc::signal<void> destroySignal;
+ mutable Geom::Affine _doc2dt;
+
public:
+ /// Document to desktop coordinate transformation.
+ const Geom::Affine &doc2dt() const;
+ /// Desktop to document coordinate transformation.
+ const Geom::Affine &dt2doc() const
+ {
+ // Note: doc2dt().inverse() happens to be identical to doc2dt()
+ return doc2dt();
+ }
+ /// True if the desktop Y-axis points down, false if it points up.
+ bool is_yaxisdown() const { return yaxisdir() > 0; }
+ /// "1" if the desktop Y-axis points down, "-1" if it points up.
+ double yaxisdir() const { return _doc2dt[3]; }
+
void addUndoObserver(Inkscape::UndoStackObserver& observer);
void removeUndoObserver(Inkscape::UndoStackObserver& observer);