Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2018 10:41:47 +0000 (12:41 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2018 10:43:36 +0000 (12:43 +0200)
1  2 
source/blender/editors/screen/screen_ops.c

index c6041d830b1b2d492b54e7f543ab95f3c2651009,44467b6a99401bbc938e8af68d45fde4ace2e0a9..7c36ced212b418218c02672dc5f701261815021c
@@@ -1871,34 -1719,29 +1899,33 @@@ static int area_split_invoke(bContext *
        }
        else {
                ScrEdge *actedge;
-               int x, y;
 +              rcti screen_rect;
+               int event_co[2];
  
                /* retrieve initial mouse coord, so we can find the active edge */
-               if (RNA_struct_property_is_set(op->ptr, "mouse_x"))
-                       x = RNA_int_get(op->ptr, "mouse_x");
-               else
-                       x = event->x;
-               if (RNA_struct_property_is_set(op->ptr, "mouse_y"))
-                       y = RNA_int_get(op->ptr, "mouse_y");
-               else
-                       y = event->x;
+               if (RNA_property_is_set(op->ptr, prop_cursor)) {
+                       RNA_property_int_get_array(op->ptr, prop_cursor, event_co);
+               }
+               else {
+                       copy_v2_v2_int(event_co, &event->x);
+               }
  
 -              actedge = screen_find_active_scredge(sc, winsize_x, winsize_y, event_co[0], event_co[1]);
 +              WM_window_screen_rect_calc(win, &screen_rect);
 +
-               actedge = screen_geom_area_map_find_active_scredge(AREAMAP_FROM_SCREEN(sc), &screen_rect, x, y);
-               if (actedge == NULL)
++              actedge = screen_geom_area_map_find_active_scredge(
++                      AREAMAP_FROM_SCREEN(sc), &screen_rect, event_co[0], event_co[1]);
+               if (actedge == NULL) {
                        return OPERATOR_CANCELLED;
+               }
  
 -              dir = scredge_is_horizontal(actedge) ? 'v' : 'h';
 +              dir = screen_geom_edge_is_horizontal(actedge) ? 'v' : 'h';
  
-               RNA_enum_set(op->ptr, "direction", dir);
+               RNA_property_enum_set(op->ptr, prop_dir, dir);
  
                /* special case, adds customdata, sets defaults */
-               if (!area_split_menu_init(C, op))
+               if (!area_split_menu_init(C, op)) {
                        return OPERATOR_CANCELLED;
+               }
        }
  
        sd = (sAreaSplitData *)op->customdata;