summaryrefslogtreecommitdiffstats
path: root/src/box3d.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-18 18:07:14 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-18 18:07:14 +0000
commite77956b4dbd029c9f6949f81fe083606f995c624 (patch)
tree74adda4df8986d65f70efb341c6235277361fd35 /src/box3d.cpp
parentupdated code to work on 0.92 code (diff)
parentLatvian translation update (diff)
downloadinkscape-e77956b4dbd029c9f6949f81fe083606f995c624.tar.gz
inkscape-e77956b4dbd029c9f6949f81fe083606f995c624.zip
update to trunk
(bzr r12588.1.39)
Diffstat (limited to 'src/box3d.cpp')
-rw-r--r--src/box3d.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/box3d.cpp b/src/box3d.cpp
index 3c0cbb675..dc04a2eb6 100644
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
@@ -37,26 +37,16 @@
#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);
static gint counter = 0;
-#include "sp-factory.h"
-
-namespace {
- SPObject* createBox3D() {
- return new SPBox3D();
- }
-
- 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 +77,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 +115,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 +200,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 +391,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 +902,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;
+ }
}