summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2007-09-11 12:25:12 +0000
committercilix42 <cilix42@users.sourceforge.net>2007-09-11 12:25:12 +0000
commit3916b60702abf416c04a3dae2e62ca556b40a082 (patch)
tree2200ba21e2e8a4bd1ab3cd2b2c412bb62d12a160 /src
parentadd select all, select all in all layers, deselect to selector toolbar (diff)
downloadinkscape-3916b60702abf416c04a3dae2e62ca556b40a082.tar.gz
inkscape-3916b60702abf416c04a3dae2e62ca556b40a082.zip
Use angle step from prefs for rotation of PLs; Alt+parentheses rotate PLs by (constant) small amount
(bzr r3720)
Diffstat (limited to 'src')
-rw-r--r--src/box3d-context.cpp13
-rw-r--r--src/perspective3d.cpp5
-rw-r--r--src/perspective3d.h2
3 files changed, 11 insertions, 9 deletions
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 818a87c6c..cb6dd1d0b 100644
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
@@ -295,6 +295,7 @@ static gint sp_3dbox_context_root_handler(SPEventContext *event_context, GdkEven
SPDesktop *desktop = event_context->desktop;
Inkscape::Selection *selection = sp_desktop_selection (desktop);
+ int const snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12);
SP3DBoxContext *bc = SP_3DBOX_CONTEXT(event_context);
@@ -452,32 +453,32 @@ static gint sp_3dbox_context_root_handler(SPEventContext *event_context, GdkEven
break;
case GDK_bracketright:
- inkscape_active_document()->current_perspective->rotate (Box3D::X, -10);
+ inkscape_active_document()->current_perspective->rotate (Box3D::X, -180/snaps, MOD__ALT);
ret = true;
break;
case GDK_bracketleft:
- inkscape_active_document()->current_perspective->rotate (Box3D::X, 10);
+ inkscape_active_document()->current_perspective->rotate (Box3D::X, 180/snaps, MOD__ALT);
ret = true;
break;
case GDK_parenright:
- inkscape_active_document()->current_perspective->rotate (Box3D::Y, -10);
+ inkscape_active_document()->current_perspective->rotate (Box3D::Y, -180/snaps, MOD__ALT);
ret = true;
break;
case GDK_parenleft:
- inkscape_active_document()->current_perspective->rotate (Box3D::Y, 10);
+ inkscape_active_document()->current_perspective->rotate (Box3D::Y, 180/snaps, MOD__ALT);
ret = true;
break;
case GDK_braceright:
- inkscape_active_document()->current_perspective->rotate (Box3D::Z, -10);
+ inkscape_active_document()->current_perspective->rotate (Box3D::Z, -180/snaps, MOD__ALT);
ret = true;
break;
case GDK_braceleft:
- inkscape_active_document()->current_perspective->rotate (Box3D::Z, 10);
+ inkscape_active_document()->current_perspective->rotate (Box3D::Z, 180/snaps, MOD__ALT);
ret = true;
break;
diff --git a/src/perspective3d.cpp b/src/perspective3d.cpp
index db4f564c7..3c7529c16 100644
--- a/src/perspective3d.cpp
+++ b/src/perspective3d.cpp
@@ -204,12 +204,13 @@ Perspective3D::set_infinite_direction (Box3D::Axis axis, NR::Point const dir)
}
void
-Perspective3D::rotate (Box3D::Axis const axis, double const angle)
+Perspective3D::rotate (Box3D::Axis const axis, double const angle, bool const alt_pressed)
{
Box3D::VanishingPoint *vp = get_vanishing_point (axis);
if (!vp->is_finite()) {
+ double add_value = angle;
double a = NR::atan2 (vp->v_dir) * 180/M_PI;
- a += angle;
+ a += alt_pressed ? 0.5 * ((angle > 0 ) - (angle < 0)) : angle; // the r.h.s. yields +/-0.5 or angle
a *= M_PI/180;
this->set_infinite_direction (axis, NR::Point (cos (a), sin (a)));
}
diff --git a/src/perspective3d.h b/src/perspective3d.h
index a431e1f99..caf503e0d 100644
--- a/src/perspective3d.h
+++ b/src/perspective3d.h
@@ -36,7 +36,7 @@ public:
void set_vanishing_point (Box3D::Axis const dir, VanishingPoint const &pt);
void set_vanishing_point (Box3D::Axis const dir, gdouble pt_x, gdouble pt_y, gdouble dir_x, gdouble dir_y, VPState st);
void set_infinite_direction (Box3D::Axis axis, NR::Point const dir);
- void rotate (Box3D::Axis const dir, double const angle);
+ void rotate (Box3D::Axis const dir, double const angle, bool const alt_pressed = false);
void add_box (SP3DBox *box);
void remove_box (const SP3DBox *box);
bool has_box (const SP3DBox *box) const;