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_cursor.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_cursor.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index c59ab6279cd..385e37f7d22 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -1224,9 +1224,13 @@ static bool paint_use_2d_cursor(ePaintMode mode) static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) { + ARegion *ar = CTX_wm_region(C); + if (ar && ar->regiontype != RGN_TYPE_WINDOW) { + return; + } + Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); - ARegion *ar = CTX_wm_region(C); UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); |