diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-07-27 14:40:29 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-07-27 14:40:29 +0000 |
| commit | 63203fb881bfce667a14b2bbb3ec2ee40a9adf77 (patch) | |
| tree | 86f322f2330dd9bd2f6719ffd7fd828bc67e4356 /src/document.cpp | |
| parent | Crashfix for connectors avoid selected items (diff) | |
| download | inkscape-63203fb881bfce667a14b2bbb3ec2ee40a9adf77.tar.gz inkscape-63203fb881bfce667a14b2bbb3ec2ee40a9adf77.zip | |
Make doc2dt a document property
Closes #340
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/document.cpp b/src/document.cpp index a9084ce10..f2be81612 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -115,6 +115,12 @@ SPDocument::SPDocument() : _node_cache_valid(false), _activexmltree(nullptr) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + + if (!prefs->getBool("/options/yaxisdown", true)) { + _doc2dt[3] = -1; + } + // Penalise libavoid for choosing paths with needless extra segments. // This results in much better looking orthogonal connector paths. router->setRoutingPenalty(Avoid::segmentPenalty); @@ -761,6 +767,15 @@ void SPDocument::setHeight(const Inkscape::Util::Quantity &height, bool changeSi root->updateRepr(); } +const Geom::Affine &SPDocument::doc2dt() const +{ + if (root && !is_yaxisdown()) { + _doc2dt[5] = root->height.computed; + } + + return _doc2dt; +} + Geom::Rect SPDocument::getViewBox() const { Geom::Rect viewBox; @@ -839,7 +854,7 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) } } - double y_dir = SP_ACTIVE_DESKTOP ? SP_ACTIVE_DESKTOP->yaxisdir() : 1; + double y_dir = yaxisdir(); if (y_dir > 0) { std::swap(margin_top, margin_bottom); |
