Merging r46725 through r46963 from trunk into soc-2011-tomato
[blender.git] / source / blender / editors / space_node / space_node.c
index 3540c20..e29f964 100644 (file)
@@ -250,6 +250,13 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
                                        break;
                        }
                        break;
+               case NC_MASK:
+                       if (wmn->action == NA_EDITED) {
+                               if (type==NTREE_COMPOSIT) {
+                                       ED_area_tag_refresh(sa);
+                               }
+                       }
+                       break;
 
                case NC_IMAGE:
                        if (wmn->action == NA_EDITED) {
@@ -339,6 +346,17 @@ static void node_buttons_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
+static void node_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
+{
+       SpaceNode *snode= sa->spacedata.first;
+       
+       /* convert mouse coordinates to v2d space */
+       UI_view2d_region_to_view(&ar->v2d, win->eventstate->x - ar->winrct.xmin, win->eventstate->y - ar->winrct.ymin,
+                                &snode->mx, &snode->my);
+       
+       node_set_cursor(win, snode);
+}
+
 /* Initialize main area, setting handlers. */
 static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
@@ -522,6 +540,8 @@ void ED_spacetype_node(void)
        art->init= node_main_area_init;
        art->draw= node_main_area_draw;
        art->listener= node_region_listener;
+       art->cursor = node_cursor;
+       art->event_cursor = TRUE;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_GPENCIL;
 
        BLI_addhead(&st->regiontypes, art);