diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-09-12 14:43:47 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-09-12 14:43:47 +0000 |
| commit | 1fa0c72b664afa4803dffd463ed11ce01632ab76 (patch) | |
| tree | c1f746d4e8f7a5d65541cf6c05d3cdc79b3f9c10 /src/object/box3d.cpp | |
| parent | Fix preferences crash (diff) | |
| download | inkscape-1fa0c72b664afa4803dffd463ed11ce01632ab76.tar.gz inkscape-1fa0c72b664afa4803dffd463ed11ce01632ab76.zip | |
New option to invert y-axis
Replaces all hard coded or implicit desktop coordinate usage with
doc2dt multiplication.
New global preference: Interface > Origin at upper left
https://bugs.launchpad.net/inkscape/+bug/170049
Diffstat (limited to 'src/object/box3d.cpp')
| -rw-r--r-- | src/object/box3d.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/object/box3d.cpp b/src/object/box3d.cpp index df95f4f84..7be7c10f7 100644 --- a/src/object/box3d.cpp +++ b/src/object/box3d.cpp @@ -149,6 +149,9 @@ 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); } @@ -156,6 +159,9 @@ 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); } @@ -227,8 +233,15 @@ Inkscape::XML::Node* SPBox3D::write(Inkscape::XML::Document *xml_doc, Inkscape:: } } - gchar *coordstr0 = box->orig_corner0.coord_string(); - gchar *coordstr7 = box->orig_corner7.coord_string(); + 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(); repr->setAttribute("inkscape:corner0", coordstr0); repr->setAttribute("inkscape:corner7", coordstr7); g_free(coordstr0); |
