summaryrefslogtreecommitdiffstats
path: root/src/box3d.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-02-02 20:08:49 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-02-02 20:08:49 +0000
commit1d3b98e5f5311479cd87f20e3656b0133bff73bd (patch)
tree95eea2fcac18f236b31053e4d1493aa644760df0 /src/box3d.cpp
parentupdate to trunk (diff)
parentTranslations. Arabic translation update. (diff)
downloadinkscape-1d3b98e5f5311479cd87f20e3656b0133bff73bd.tar.gz
inkscape-1d3b98e5f5311479cd87f20e3656b0133bff73bd.zip
update to trunk
(bzr r13645.1.4)
Diffstat (limited to 'src/box3d.cpp')
-rw-r--r--src/box3d.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/box3d.cpp b/src/box3d.cpp
index 3c0cbb675..86f99049b 100644
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
@@ -37,7 +37,7 @@
#include "preferences.h"
#include "desktop.h"
-#include "desktop-handles.h"
+
#include "macros.h"
static void box3d_ref_changed(SPObject *old_ref, SPObject *ref, SPBox3D *box);
@@ -47,16 +47,16 @@ static gint counter = 0;
#include "sp-factory.h"
namespace {
- SPObject* createBox3D() {
- return new SPBox3D();
- }
+ SPObject* createBox3D() {
+ return new SPBox3D();
+ }
- bool box3DRegistered = SPFactory::instance().registerObject("inkscape:box3d", createBox3D);
+ bool box3DRegistered = SPFactory::instance().registerObject("inkscape:box3d", createBox3D);
}
SPBox3D::SPBox3D() : SPGroup() {
- this->my_counter = 0;
- this->swapped = Box3D::NONE;
+ this->my_counter = 0;
+ this->swapped = Box3D::NONE;
this->persp_href = NULL;
this->persp_ref = new Persp3DReference(this);
@@ -87,7 +87,7 @@ void SPBox3D::build(SPDocument *document, Inkscape::XML::Node *repr) {
}
void SPBox3D::release() {
- SPBox3D* object = this;
+ SPBox3D* object = this;
SPBox3D *box = object;
if (box->persp_href) {
@@ -125,7 +125,7 @@ void SPBox3D::release() {
}
void SPBox3D::set(unsigned int key, const gchar* value) {
- SPBox3D* object = this;
+ SPBox3D* object = this;
SPBox3D *box = object;
switch (key) {
@@ -210,7 +210,7 @@ void SPBox3D::update(SPCtx *ctx, guint flags) {
}
Inkscape::XML::Node* SPBox3D::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
- SPBox3D* object = this;
+ SPBox3D* object = this;
SPBox3D *box = object;
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
@@ -401,7 +401,7 @@ box3d_snap (SPBox3D *box, int id, Proj::Pt3 const &pt_proj, Proj::Pt3 const &sta
snap_pts[3] = diag2.closest_to (pt);
}
- gdouble const zoom = inkscape_active_desktop()->current_zoom();
+ gdouble const zoom = SP_ACTIVE_DESKTOP->current_zoom();
// determine the distances to all potential snapping points
double snap_dists[MAX_POINT_COUNT];
@@ -912,9 +912,11 @@ box3d_swap_sides(int z_orders[6], Box3D::Axis axis) {
}
}
- int tmp = z_orders[pos1];
- z_orders[pos1] = z_orders[pos2];
- z_orders[pos2] = tmp;
+ if (pos1 != -1){
+ int tmp = z_orders[pos1];
+ z_orders[pos1] = z_orders[pos2];
+ z_orders[pos2] = tmp;
+ }
}