summaryrefslogtreecommitdiffstats
path: root/src/axis-manip.h
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2007-08-07 08:05:16 +0000
committercilix42 <cilix42@users.sourceforge.net>2007-08-07 08:05:16 +0000
commit977777edd809ed276b2b5e2941041373510b0b13 (patch)
tree89fa394323d5671dd2a629430863edc6f53f9a96 /src/axis-manip.h
parentDon't reshape boxes in the direction of infinite VPs when dragging VPs (fixes... (diff)
downloadinkscape-977777edd809ed276b2b5e2941041373510b0b13.tar.gz
inkscape-977777edd809ed276b2b5e2941041373510b0b13.zip
Compute the correct visible front corner (also for 'upended' boxes) and set the z-orders accordingly so that they are correct for any relative position of the handles
(bzr r3411)
Diffstat (limited to 'src/axis-manip.h')
-rw-r--r--src/axis-manip.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/axis-manip.h b/src/axis-manip.h
index 5690eedcb..8574bf3ff 100644
--- a/src/axis-manip.h
+++ b/src/axis-manip.h
@@ -75,6 +75,16 @@ inline bool is_single_axis_direction (Box3D::Axis dir) {
return (!(dir & (dir - 1)) && dir);
}
+// Warning: We don't check that axis really unamiguously specifies a plane.
+// Make sure this is the case when calling this function.
+inline guint face_containing_corner (Box3D::Axis axis, guint corner) {
+ if (!is_single_axis_direction (axis)) {
+ axis = (Box3D::Axis) (axis ^ Box3D::XYZ);
+ }
+ return face_to_int (axis ^ ((corner & axis) ? Box3D::REAR : Box3D::FRONT));
+}
+
+
/**
* Given two axis directions out of {X, Y, Z} or the corresponding plane, return the remaining one
* We don't check if 'plane' really specifies a plane (i.e., if it consists of precisely two directions).