Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-10-24 17:27:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-24 17:27:20 +0300
commit0c66039cfdfd0376ce04b7522af9702284a199f0 (patch)
tree51bca04576b7a7e8469bb65b1d9b2034719d593e /source
parentb35c14f0150cabc12ba61c29bdc30c90ab02522e (diff)
parentad3f9c6dfe0f8e061594c856b9b16ac4dfee8cc7 (diff)
Merge branch 'blender-v2.81-release'
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/context.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c11
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h2
4 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 7f2f04d7eb5..2e4f756ce68 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -758,7 +758,7 @@ RegionView3D *CTX_wm_region_view3d(const bContext *C)
ARegion *ar = CTX_wm_region(C);
if (sa && sa->spacetype == SPACE_VIEW3D) {
- if (ar) {
+ if (ar && ar->regiontype == RGN_TYPE_WINDOW) {
return ar->regiondata;
}
}
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);
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;
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 19380fb9022..84665728e17 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -191,7 +191,7 @@ struct ImagePaintPartialRedraw *get_imapaintpartial(void);
void set_imapaintpartial(struct ImagePaintPartialRedraw *ippr);
void imapaint_region_tiles(
struct ImBuf *ibuf, int x, int y, int w, int h, int *tx, int *ty, int *tw, int *th);
-int get_imapaint_zoom(struct bContext *C, float *zoomx, float *zoomy);
+bool get_imapaint_zoom(struct bContext *C, float *zoomx, float *zoomy);
void *paint_2d_new_stroke(struct bContext *, struct wmOperator *, int mode);
void paint_2d_redraw(const struct bContext *C, void *ps, bool final);
void paint_2d_stroke_done(void *ps);