summaryrefslogtreecommitdiffstats
path: root/src/pen-context.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-07-14 21:09:41 +0000
committerMarkus Engel <markus.engel@tum.de>2013-07-14 21:09:41 +0000
commitd32efb61f1c2c18d1018e510bbe9bafc04a03905 (patch)
treeb447bf9856baf1cf485e38c4ce55edb27285129e /src/pen-context.cpp
parentMerged from trunk (r12305) (diff)
parentMinor C++ish refactoring pass. (diff)
downloadinkscape-d32efb61f1c2c18d1018e510bbe9bafc04a03905.tar.gz
inkscape-d32efb61f1c2c18d1018e510bbe9bafc04a03905.zip
Merged from trunk (r12419).
(bzr r11608.1.107)
Diffstat (limited to 'src/pen-context.cpp')
-rw-r--r--src/pen-context.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index 4281fdc54..21fc4fc51 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -944,13 +944,13 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_KEY_Left: // move last point left
case GDK_KEY_KP_Left:
- if (!MOD__CTRL) { // not ctrl
- if (MOD__ALT) { // alt
- if (MOD__SHIFT) pen_lastpoint_move_screen(pc, -10, 0); // shift
+ if (!MOD__CTRL(event)) { // not ctrl
+ if (MOD__ALT(event)) { // alt
+ if (MOD__SHIFT(event)) pen_lastpoint_move_screen(pc, -10, 0); // shift
else pen_lastpoint_move_screen(pc, -1, 0); // no shift
}
else { // no alt
- if (MOD__SHIFT) pen_lastpoint_move(pc, -10*nudge, 0); // shift
+ if (MOD__SHIFT(event)) pen_lastpoint_move(pc, -10*nudge, 0); // shift
else pen_lastpoint_move(pc, -nudge, 0); // no shift
}
ret = TRUE;
@@ -958,13 +958,13 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
break;
case GDK_KEY_Up: // move last point up
case GDK_KEY_KP_Up:
- if (!MOD__CTRL) { // not ctrl
- if (MOD__ALT) { // alt
- if (MOD__SHIFT) pen_lastpoint_move_screen(pc, 0, 10); // shift
+ if (!MOD__CTRL(event)) { // not ctrl
+ if (MOD__ALT(event)) { // alt
+ if (MOD__SHIFT(event)) pen_lastpoint_move_screen(pc, 0, 10); // shift
else pen_lastpoint_move_screen(pc, 0, 1); // no shift
}
else { // no alt
- if (MOD__SHIFT) pen_lastpoint_move(pc, 0, 10*nudge); // shift
+ if (MOD__SHIFT(event)) pen_lastpoint_move(pc, 0, 10*nudge); // shift
else pen_lastpoint_move(pc, 0, nudge); // no shift
}
ret = TRUE;
@@ -972,13 +972,13 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
break;
case GDK_KEY_Right: // move last point right
case GDK_KEY_KP_Right:
- if (!MOD__CTRL) { // not ctrl
- if (MOD__ALT) { // alt
- if (MOD__SHIFT) pen_lastpoint_move_screen(pc, 10, 0); // shift
+ if (!MOD__CTRL(event)) { // not ctrl
+ if (MOD__ALT(event)) { // alt
+ if (MOD__SHIFT(event)) pen_lastpoint_move_screen(pc, 10, 0); // shift
else pen_lastpoint_move_screen(pc, 1, 0); // no shift
}
else { // no alt
- if (MOD__SHIFT) pen_lastpoint_move(pc, 10*nudge, 0); // shift
+ if (MOD__SHIFT(event)) pen_lastpoint_move(pc, 10*nudge, 0); // shift
else pen_lastpoint_move(pc, nudge, 0); // no shift
}
ret = TRUE;
@@ -986,13 +986,13 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
break;
case GDK_KEY_Down: // move last point down
case GDK_KEY_KP_Down:
- if (!MOD__CTRL) { // not ctrl
- if (MOD__ALT) { // alt
- if (MOD__SHIFT) pen_lastpoint_move_screen(pc, 0, -10); // shift
+ if (!MOD__CTRL(event)) { // not ctrl
+ if (MOD__ALT(event)) { // alt
+ if (MOD__SHIFT(event)) pen_lastpoint_move_screen(pc, 0, -10); // shift
else pen_lastpoint_move_screen(pc, 0, -1); // no shift
}
else { // no alt
- if (MOD__SHIFT) pen_lastpoint_move(pc, 0, -10*nudge); // shift
+ if (MOD__SHIFT(event)) pen_lastpoint_move(pc, 0, -10*nudge); // shift
else pen_lastpoint_move(pc, 0, -nudge); // no shift
}
ret = TRUE;
@@ -1002,7 +1002,7 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
/*TODO: this is not yet enabled?? looks like some traces of the Geometry tool
case GDK_KEY_P:
case GDK_KEY_p:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
sp_pen_context_wait_for_LPE_mouse_clicks(pc, Inkscape::LivePathEffect::PARALLEL, 2);
ret = TRUE;
}
@@ -1010,7 +1010,7 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_KEY_C:
case GDK_KEY_c:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
sp_pen_context_wait_for_LPE_mouse_clicks(pc, Inkscape::LivePathEffect::CIRCLE_3PTS, 3);
ret = TRUE;
}
@@ -1018,7 +1018,7 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_KEY_B:
case GDK_KEY_b:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
sp_pen_context_wait_for_LPE_mouse_clicks(pc, Inkscape::LivePathEffect::PERP_BISECTOR, 2);
ret = TRUE;
}
@@ -1026,7 +1026,7 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_KEY_A:
case GDK_KEY_a:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
sp_pen_context_wait_for_LPE_mouse_clicks(pc, Inkscape::LivePathEffect::ANGLE_BISECTOR, 3);
ret = TRUE;
}
@@ -1035,14 +1035,14 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_KEY_U:
case GDK_KEY_u:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
pen_lastpoint_tocurve(pc);
ret = TRUE;
}
break;
case GDK_KEY_L:
case GDK_KEY_l:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
pen_lastpoint_toline(pc);
ret = TRUE;
}
@@ -1064,7 +1064,7 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
break;
case GDK_KEY_z:
case GDK_KEY_Z:
- if (MOD__CTRL_ONLY && pc->npoints != 0) {
+ if (MOD__CTRL_ONLY(event) && pc->npoints != 0) {
// if drawing, cancel, otherwise pass it up for undo
pen_cancel (pc);
ret = TRUE;
@@ -1072,7 +1072,7 @@ static gint pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
break;
case GDK_KEY_g:
case GDK_KEY_G:
- if (MOD__SHIFT_ONLY) {
+ if (MOD__SHIFT_ONLY(event)) {
sp_selection_to_guides(SP_EVENT_CONTEXT(pc)->desktop);
ret = true;
}