summaryrefslogtreecommitdiffstats
path: root/src/box3d-context.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2007-08-06 08:01:03 +0000
committercilix42 <cilix42@users.sourceforge.net>2007-08-06 08:01:03 +0000
commitfb491e2d6b0efcf65332bd13baf1bca429fdfe82 (patch)
treeeb1661358ca5e69f8b45b6ae305c87e99be4efae /src/box3d-context.cpp
parent(Un-)Snapping of VPs by Shift-dragging; this makes it possible to separate pe... (diff)
downloadinkscape-fb491e2d6b0efcf65332bd13baf1bca429fdfe82.tar.gz
inkscape-fb491e2d6b0efcf65332bd13baf1bca429fdfe82.zip
Draw perspective lines; provide shortcuts to toggle their visibility and the corners where they are attached
(bzr r3393)
Diffstat (limited to 'src/box3d-context.cpp')
-rw-r--r--src/box3d-context.cpp60
1 files changed, 57 insertions, 3 deletions
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 3096ad179..a753f5f50 100644
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
@@ -440,13 +440,67 @@ static gint sp_3dbox_context_root_handler(SPEventContext *event_context, GdkEven
ret = true;
break;
+ case GDK_L:
+ case GDK_l:
+ bc->_vpdrag->show_lines = !bc->_vpdrag->show_lines;
+ bc->_vpdrag->updateLines();
+ ret = true;
+ break;
+
+ case GDK_A:
+ case GDK_a:
+ if (MOD__CTRL) break; // Don't catch Ctrl+A ("select all")
+ if (bc->_vpdrag->show_lines) {
+ bc->_vpdrag->front_or_rear_lines = bc->_vpdrag->front_or_rear_lines ^ 0x2; // toggle rear PLs
+ }
+ bc->_vpdrag->updateLines();
+ ret = true;
+ break;
+
case GDK_x:
case GDK_X:
- if (MOD__ALT_ONLY) {
- // desktop->setToolboxFocusTo ("altx-rect");
- ret = TRUE;
+ {
+ if (MOD__CTRL) break; // Don't catch Ctrl+X ('cut') and Ctrl+Shift+X ('open XML editor')
+ // FIXME: Shouldn't we access _vpdrag->selection instead?
+ Inkscape::Selection *selection = sp_desktop_selection (bc->_vpdrag->desktop);
+ for (GSList const *i = selection->itemList(); i != NULL; i = i->next) {
+ if (!SP_IS_3DBOX (i->data)) continue;
+ sp_3dbox_switch_front_face (SP_3DBOX (i->data), Box3D::X);
+ }
+ bc->_vpdrag->updateLines();
+ ret = true;
+ break;
+ }
+
+ case GDK_y:
+ case GDK_Y:
+ {
+ if (MOD__CTRL) break; // Don't catch Ctrl+Y ("redo")
+ // FIXME: Shouldn't we access _vpdrag->selection instead?
+ Inkscape::Selection *selection = sp_desktop_selection (bc->_vpdrag->desktop);
+ for (GSList const *i = selection->itemList(); i != NULL; i = i->next) {
+ if (!SP_IS_3DBOX (i->data)) continue;
+ sp_3dbox_switch_front_face (SP_3DBOX (i->data), Box3D::Y);
+ }
+ bc->_vpdrag->updateLines();
+ ret = true;
+ break;
+ }
+
+ case GDK_z:
+ case GDK_Z:
+ {
+ if (MOD__CTRL) break; // Don't catch Ctrl+Z ("undo")
+ // FIXME: Shouldn't we access _vpdrag->selection instead?
+ Inkscape::Selection *selection = sp_desktop_selection (bc->_vpdrag->desktop);
+ for (GSList const *i = selection->itemList(); i != NULL; i = i->next) {
+ if (!SP_IS_3DBOX (i->data)) continue;
+ sp_3dbox_switch_front_face (SP_3DBOX (i->data), Box3D::Z);
}
+ bc->_vpdrag->updateLines();
+ ret = true;
break;
+ }
case GDK_Escape:
sp_desktop_selection(desktop)->clear();