diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-24 17:25:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-24 17:25:23 +0300 |
commit | ad3f9c6dfe0f8e061594c856b9b16ac4dfee8cc7 (patch) | |
tree | f586a60ad3b02c1cae0bd653b085ab5f746f5400 /source/blender/editors/sculpt_paint/paint_image.c | |
parent | ce6e7a094173c288e497e982c55b33f2135d83be (diff) |
Fix crash drawing the paint cursor over the redo region
Also fix CTX_wm_region_view3d which didn't check the region type.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index b4388f6c324..9acc189ae95 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -759,17 +759,14 @@ void PAINT_OT_image_paint(wmOperatorType *ot) paint_stroke_operator_properties(ot); } -int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) +bool get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) { - RegionView3D *rv3d = CTX_wm_region_view3d(C); - - if (!rv3d) { - SpaceImage *sima = CTX_wm_space_image(C); - + ScrArea *sa = CTX_wm_area(C); + if (sa && sa->spacetype == SPACE_IMAGE) { + SpaceImage *sima = sa->spacedata.first; if (sima->mode == SI_MODE_PAINT) { ARegion *ar = CTX_wm_region(C); ED_space_image_get_zoom(sima, ar, zoomx, zoomy); - return 1; } } |