Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-04-04 04:21:37 +0400
committerMatt Ebb <matt@mke3.net>2010-04-04 04:21:37 +0400
commit4021db8af82bb96ecd727e1a3374367f189ce415 (patch)
tree5d6f17a343de82b37e34074b707dcdcadfe935c2 /source/blender/windowmanager/intern/wm_gesture.c
parent069e955a1d07a8f5fd83ac7777e6df8c918570b6 (diff)
Added a new 'straight line' gesture type that can be used in any operator.
Use this for image editor Line Sample tool, rather than custom modal operator/ custom drawing.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_gesture.c')
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index fd7ae142cbd..e87d2d79c39 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -70,7 +70,7 @@ wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
wm_subwindow_getorigin(window, gesture->swinid, &sx, &sy);
- if( ELEM4(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK, WM_GESTURE_CIRCLE)) {
+ if( ELEM5(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK, WM_GESTURE_CIRCLE, WM_GESTURE_STRAIGHTLINE)) {
rcti *rect= MEM_callocN(sizeof(rcti), "gesture rect new");
gesture->customdata= rect;
@@ -335,6 +335,8 @@ void wm_gesture_draw(wmWindow *win)
wm_gesture_draw_lasso(win, gt);
else if(gt->type==WM_GESTURE_LASSO)
wm_gesture_draw_lasso(win, gt);
+ else if(gt->type==WM_GESTURE_STRAIGHTLINE)
+ wm_gesture_draw_line(win, gt);
}
}