Merge branch 'blender-v2.81-release'

This commit is contained in:
Campbell Barton 2019-10-25 01:27:20 +11:00
commit 0c66039cfd
4 changed files with 11 additions and 10 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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);