diff options
| author | Thomas Holder <thomas.holder@schrodinger.com> | 2018-09-14 08:54:56 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas.holder@schrodinger.com> | 2018-09-14 09:01:46 +0000 |
| commit | c26620643cd86cf84e9f1672b61109fcd9d98b4f (patch) | |
| tree | 3860bd6015654eef462bf73408e24c8d298d370e /src/object/persp3d.cpp | |
| parent | Fix a bug opening SVG from comand lines related to the DPI changes done. Than... (diff) | |
| download | inkscape-c26620643cd86cf84e9f1672b61109fcd9d98b4f.tar.gz inkscape-c26620643cd86cf84e9f1672b61109fcd9d98b4f.zip | |
fix 3D boxes with inverted y-axis (follow-up)
The initial fix was only correct for parallel/infinite Y direction
Diffstat (limited to 'src/object/persp3d.cpp')
| -rw-r--r-- | src/object/persp3d.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/object/persp3d.cpp b/src/object/persp3d.cpp index 05ba5898b..5c6835e28 100644 --- a/src/object/persp3d.cpp +++ b/src/object/persp3d.cpp @@ -96,8 +96,11 @@ static Proj::Pt2 legacy_transform_forward(Proj::Pt2 pt, SPDocument const *doc) { } // <inkscape:perspective> stores inverted y-axis coordinates - if (pt[2] && SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { - pt[1] = doc->getHeight().value("px") - pt[1]; + if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { + pt[1] *= -1; + if (pt[2]) { + pt[1] += doc->getHeight().value("px"); + } } return pt; @@ -108,8 +111,11 @@ static Proj::Pt2 legacy_transform_forward(Proj::Pt2 pt, SPDocument const *doc) { */ static Proj::Pt2 legacy_transform_backward(Proj::Pt2 pt, SPDocument const *doc) { // <inkscape:perspective> stores inverted y-axis coordinates - if (pt[2] && SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { - pt[1] = doc->getHeight().value("px") - pt[1]; + if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { + pt[1] *= -1; + if (pt[2]) { + pt[1] += doc->getHeight().value("px"); + } } // Written values are in 'user units'. |
