Merging r49212 through r49222 from trunk into soc-2011-tomato
[blender.git] / source / blender / editors / space_image / space_image.c
index 3c9c46c1c75e0327ecacb0ffdd72a1058e321056..a7f8fade9ea82ccacc789e6ad52d2dbde13096e6 100644 (file)
@@ -149,6 +149,8 @@ static SpaceLink *image_new(const bContext *UNUSED(C))
        simage->zoom = 1.0f;
        simage->lock = TRUE;
 
+       BKE_color_managed_view_settings_init(&simage->view_settings);
+
        simage->iuser.ok = TRUE;
        simage->iuser.fie_ima = 2;
        simage->iuser.frames = 100;
@@ -211,6 +213,7 @@ static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
 
 static SpaceLink *image_duplicate(SpaceLink *sl)
 {
+       SpaceImage *simage = (SpaceImage *) sl;
        SpaceImage *simagen = MEM_dupallocN(sl);
        
        /* clear or remove stuff from old */
@@ -219,6 +222,8 @@ static SpaceLink *image_duplicate(SpaceLink *sl)
 
        scopes_new(&simagen->scopes);
 
+       BKE_color_managed_view_settings_copy(&simagen->view_settings, &simage->view_settings);
+
        return (SpaceLink *)simagen;
 }
 
@@ -605,7 +610,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
        image_main_area_set_view2d(sima, ar);
 
        /* we draw image in pixelspace */
-       draw_image_main(sima, ar, scene);
+       draw_image_main(C, ar);
 
        /* and uvs in 0.0-1.0 space */
        UI_view2d_view_ortho(v2d);