2.5
authorTon Roosendaal <ton@blender.org>
Sat, 31 Jan 2009 10:00:08 +0000 (10:00 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 31 Jan 2009 10:00:08 +0000 (10:00 +0000)
- Made standard border operator calls bail out on zero sized borders
- Fixed compile warning in call to BKE_animsys_evaluate_animdata()

source/blender/blenkernel/intern/action.c
source/blender/windowmanager/intern/wm_operators.c

index 3758f9ba0db852bb10037ff2ebe9ae3eaf38bb7a..c05aad07fce9fb4fa4a6b4a4517c89c857bf4c11 100644 (file)
@@ -710,7 +710,7 @@ void what_does_obaction (Scene *scene, Object *ob, Object *workob, bPose *pose,
        adt.action= act;
        
        /* execute effects of Action on to workob (or it's PoseChannels) */
-       BKE_animsys_evaluate_animdata(workob, &adt, cframe, ADT_RECALC_ANIM);
+       BKE_animsys_evaluate_animdata(&workob->id, &adt, cframe, ADT_RECALC_ANIM);
 }
 
 /* ********** NLA with non-poses works with ipo channels ********** */
index 9d59e71981e14c13df5593c075c1fe5bc586ab70..a496ebc3bea91b25d9ee597f84eef271858b86e2 100644 (file)
@@ -519,7 +519,7 @@ void WM_paint_cursor_end(wmWindowManager *wm, void *handle)
    It stores 4 values (xmin, xmax, ymin, ymax) and event it ended with (event_type)
 */
 
-static void border_apply(bContext *C, wmOperator *op, int event_type)
+static int border_apply(bContext *C, wmOperator *op, int event_type)
 {
        wmGesture *gesture= op->customdata;
        rcti *rect= gesture->customdata;
@@ -529,15 +529,20 @@ static void border_apply(bContext *C, wmOperator *op, int event_type)
        if(rect->ymin > rect->ymax)
                SWAP(int, rect->ymin, rect->ymax);
        
-       /* operator arguments and storage. */
-       RNA_int_set(op->ptr, "xmin", rect->xmin);
-       RNA_int_set(op->ptr, "ymin", rect->ymin);
-       RNA_int_set(op->ptr, "xmax", rect->xmax);
-       RNA_int_set(op->ptr, "ymax", rect->ymax);
-       if( RNA_struct_find_property(op->ptr, "event_type") )
-               RNA_int_set(op->ptr, "event_type", event_type);
-       
-       op->type->exec(C, op);
+       if(rect->xmin==rect->xmax || rect->ymin==rect->ymax)
+               return 0;
+       else {
+               
+               /* operator arguments and storage. */
+               RNA_int_set(op->ptr, "xmin", rect->xmin);
+               RNA_int_set(op->ptr, "ymin", rect->ymin);
+               RNA_int_set(op->ptr, "xmax", rect->xmax);
+               RNA_int_set(op->ptr, "ymax", rect->ymax);
+               if( RNA_struct_find_property(op->ptr, "event_type") )
+                       RNA_int_set(op->ptr, "event_type", event_type);
+               
+               op->type->exec(C, op);
+       }
 }
 
 static void wm_gesture_end(bContext *C, wmOperator *op)
@@ -597,9 +602,12 @@ int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
                                }
                        }
                        else {
-                               border_apply(C, op, event->type);
+                               if(border_apply(C, op, event->type)) {
+                                       wm_gesture_end(C, op);
+                                       return OPERATOR_FINISHED;
+                               }
                                wm_gesture_end(C, op);
-                               return OPERATOR_FINISHED;
+                               return OPERATOR_CANCELLED;
                        }
                        break;
                case ESCKEY: