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:
authorTon Roosendaal <ton@blender.org>2009-02-07 17:03:34 +0300
committerTon Roosendaal <ton@blender.org>2009-02-07 17:03:34 +0300
commit875a08884ba670387299a0baef19ace90170d271 (patch)
tree9eb93b650166385b82ab60965abf8416d5baf23b /source/blender/windowmanager/intern/wm_gesture.c
parentd21a4780dabb8827eeed2a82079aa468594763c6 (diff)
2.5
- Node editor: link cut back, now under ALT+LMB, to prevent accidents. Note it now nicely intersects the real curved noodles with a line you draw! - To make above work, replaced ogl curve draw with own bezier code. - Added new WM standard operator callback for lines-gesture, the Lasso gesture now draws a closed line. - Both callbacks have optional property 'cursor' to make it give modal info. For future also linestyle or color can be defined. - Changed 'pin' icon in Image header to something that looks less scary... but there's no pin icon yet?
Diffstat (limited to 'source/blender/windowmanager/intern/wm_gesture.c')
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 2f4ded00de5..c899d1d290e 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -83,7 +83,7 @@ wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
rect->ymax= event->y - sy;
}
}
- else if (type==WM_GESTURE_LASSO) {
+ else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) {
short *lasso;
gesture->customdata= lasso= MEM_callocN(2*sizeof(short)*WM_LASSO_MAX_POINTS, "lasso points");
lasso[0] = event->x - sx;
@@ -201,6 +201,8 @@ static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt)
glBegin(GL_LINE_STRIP);
for(i=0; i<gt->points; i++, lasso+=2)
glVertex2sv(lasso);
+ if(gt->type==WM_GESTURE_LASSO)
+ glVertex2sv((short *)gt->customdata);
glEnd();
glColor3ub(255, 255, 255);
@@ -209,6 +211,8 @@ static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt)
lasso= (short *)gt->customdata;
for(i=0; i<gt->points; i++, lasso+=2)
glVertex2sv(lasso);
+ if(gt->type==WM_GESTURE_LASSO)
+ glVertex2sv((short *)gt->customdata);
glEnd();
glDisable(GL_LINE_STIPPLE);
@@ -253,6 +257,8 @@ void wm_gesture_draw(wmWindow *win)
else
wm_gesture_draw_cross(win, gt);
}
+ else if(gt->type==WM_GESTURE_LINES)
+ wm_gesture_draw_lasso(win, gt);
else if(gt->type==WM_GESTURE_LASSO)
wm_gesture_draw_lasso(win, gt);
}