diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 20:33:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 20:33:02 +0400 |
commit | 74e4ad20c9e8d19f85aaa2995652e3f65bdfc0c9 (patch) | |
tree | 7f20ead7facacb69f02ab9384bcd855598878133 /source/blender/editors/sculpt_paint | |
parent | f4f3a9b08b04077e6e9272e4fdd4cd550b47be02 (diff) |
2.5: code cleanup, added CTX_wm_space_* for each space type,
instead of casting everywhere.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index b190b76a81e..48e07b7a489 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4387,10 +4387,9 @@ static int image_paint_poll(bContext *C) return 1; } else { - ScrArea *sa= CTX_wm_area(C); - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); + SpaceImage *sima= CTX_wm_space_image(C); - if(sa && sa->spacetype==SPACE_IMAGE) { + if(sima) { ARegion *ar= CTX_wm_region(C); if((sima->flag & SI_DRAWTOOL) && ar->regiontype==RGN_TYPE_WINDOW) @@ -4507,7 +4506,7 @@ static int paint_init(bContext *C, wmOperator *op) view3d_set_viewcontext(C, &pop->vc); } else { - pop->s.sima= (SpaceImage*)CTX_wm_space_data(C); + pop->s.sima= CTX_wm_space_image(C); pop->s.v2d= &CTX_wm_region(C)->v2d; } @@ -4815,7 +4814,7 @@ static int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) RegionView3D *rv3d= CTX_wm_region_view3d(C); if(!rv3d) { - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); + SpaceImage *sima= CTX_wm_space_image(C); ARegion *ar= CTX_wm_region(C); ED_space_image_zoom(sima, ar, zoomx, zoomy); |