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/box3d.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/box3d.cpp')
| -rw-r--r-- | src/object/box3d.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/object/box3d.cpp b/src/object/box3d.cpp index 7be7c10f7..febfef115 100644 --- a/src/object/box3d.cpp +++ b/src/object/box3d.cpp @@ -149,9 +149,6 @@ void SPBox3D::set(unsigned int key, const gchar* value) { case SP_ATTR_INKSCAPE_BOX3D_CORNER0: if (value && strcmp(value, "0 : 0 : 0 : 0")) { box->orig_corner0 = Proj::Pt3(value); - if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { - box->orig_corner0[Proj::Y] *= -1; - } box->save_corner0 = box->orig_corner0; box3d_position_set(box); } @@ -159,9 +156,6 @@ void SPBox3D::set(unsigned int key, const gchar* value) { case SP_ATTR_INKSCAPE_BOX3D_CORNER7: if (value && strcmp(value, "0 : 0 : 0 : 0")) { box->orig_corner7 = Proj::Pt3(value); - if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { - box->orig_corner7[Proj::Y] *= -1; - } box->save_corner7 = box->orig_corner7; box3d_position_set(box); } @@ -233,15 +227,8 @@ Inkscape::XML::Node* SPBox3D::write(Inkscape::XML::Document *xml_doc, Inkscape:: } } - auto corner0 = box->orig_corner0; - auto corner7 = box->orig_corner7; - if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { - corner0[Proj::Y] *= -1; - corner7[Proj::Y] *= -1; - } - - gchar *coordstr0 = corner0.coord_string(); - gchar *coordstr7 = corner7.coord_string(); + gchar *coordstr0 = box->orig_corner0.coord_string(); + gchar *coordstr7 = box->orig_corner7.coord_string(); repr->setAttribute("inkscape:corner0", coordstr0); repr->setAttribute("inkscape:corner7", coordstr7); g_free(coordstr0); @@ -665,6 +652,12 @@ box3d_XY_axes_are_swapped (SPBox3D *box) { static inline void box3d_aux_set_z_orders (int z_orders[6], int a, int b, int c, int d, int e, int f) { + if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->is_yaxisdown()) { + std::swap(a, f); + std::swap(b, e); + std::swap(c, d); + } + z_orders[0] = a; z_orders[1] = b; z_orders[2] = c; |
