Cleanup: Editors/Screen, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/screen` module. No functional changes.
This commit is contained in:
parent
4283da83cc
commit
fd5b093f84
|
@ -531,7 +531,7 @@ void ED_region_do_draw(bContext *C, ARegion *region)
|
|||
return;
|
||||
}
|
||||
/* optional header info instead? */
|
||||
else if (region->headerstr) {
|
||||
if (region->headerstr) {
|
||||
region_draw_status_text(area, region);
|
||||
}
|
||||
else if (at->draw) {
|
||||
|
@ -1128,9 +1128,8 @@ static int rct_fits(const rcti *rect, char dir, int size)
|
|||
if (dir == 'h') {
|
||||
return BLI_rcti_size_x(rect) + 1 - size;
|
||||
}
|
||||
else { /* 'v' */
|
||||
return BLI_rcti_size_y(rect) + 1 - size;
|
||||
}
|
||||
/* 'v' */
|
||||
return BLI_rcti_size_y(rect) + 1 - size;
|
||||
}
|
||||
|
||||
/* *************************************************************** */
|
||||
|
@ -1176,18 +1175,14 @@ static void region_overlap_fix(ScrArea *area, ARegion *region)
|
|||
region->flag |= RGN_FLAG_TOO_SMALL;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
BLI_rcti_translate(®ion->winrct, ar1->winx, 0);
|
||||
}
|
||||
BLI_rcti_translate(®ion->winrct, ar1->winx, 0);
|
||||
}
|
||||
else if (align1 == RGN_ALIGN_RIGHT) {
|
||||
if (region->winrct.xmin - ar1->winx < U.widget_unit) {
|
||||
region->flag |= RGN_FLAG_TOO_SMALL;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
BLI_rcti_translate(®ion->winrct, -ar1->winx, 0);
|
||||
}
|
||||
BLI_rcti_translate(®ion->winrct, -ar1->winx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3014,7 +3009,7 @@ ScrArea *ED_screen_areas_iter_first(const wmWindow *win, const bScreen *screen)
|
|||
if (!global_area) {
|
||||
return screen->areabase.first;
|
||||
}
|
||||
else if ((global_area->global->flag & GLOBAL_AREA_IS_HIDDEN) == 0) {
|
||||
if ((global_area->global->flag & GLOBAL_AREA_IS_HIDDEN) == 0) {
|
||||
return global_area;
|
||||
}
|
||||
/* Find next visible area. */
|
||||
|
|
|
@ -495,16 +495,15 @@ float bglPolygonOffsetCalc(const float winmat[16], float viewdist, float dist)
|
|||
UNUSED_VARS(viewdist);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/* This adjustment effectively results in reducing the Z value by 0.25%.
|
||||
*
|
||||
* winmat[14] actually evaluates to `-2 * far * near / (far - near)`,
|
||||
* is very close to -0.2 with default clip range,
|
||||
* and is used as the coefficient multiplied by `w / z`,
|
||||
* thus controlling the z dependent part of the depth value.
|
||||
*/
|
||||
return winmat[14] * -0.0025f * dist;
|
||||
}
|
||||
|
||||
/* This adjustment effectively results in reducing the Z value by 0.25%.
|
||||
*
|
||||
* winmat[14] actually evaluates to `-2 * far * near / (far - near)`,
|
||||
* is very close to -0.2 with default clip range,
|
||||
* and is used as the coefficient multiplied by `w / z`,
|
||||
* thus controlling the z dependent part of the depth value.
|
||||
*/
|
||||
return winmat[14] * -0.0025f * dist;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -752,9 +751,7 @@ int ED_draw_imbuf_method(ImBuf *ibuf)
|
|||
|
||||
return (size > threshold) ? IMAGE_DRAW_METHOD_2DTEXTURE : IMAGE_DRAW_METHOD_GLSL;
|
||||
}
|
||||
else {
|
||||
return U.image_draw_method;
|
||||
}
|
||||
return U.image_draw_method;
|
||||
}
|
||||
|
||||
/* don't move to GPU_immediate_util.h because this uses user-prefs
|
||||
|
|
|
@ -125,11 +125,11 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_dir_set(result, screen_context_dir);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "scene")) {
|
||||
if (CTX_data_equals(member, "scene")) {
|
||||
CTX_data_id_pointer_set(result, &scene->id);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "visible_objects")) {
|
||||
if (CTX_data_equals(member, "visible_objects")) {
|
||||
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
|
||||
if (BASE_VISIBLE(v3d, base)) {
|
||||
CTX_data_id_list_add(result, &base->object->id);
|
||||
|
@ -138,7 +138,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "selectable_objects")) {
|
||||
if (CTX_data_equals(member, "selectable_objects")) {
|
||||
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
CTX_data_id_list_add(result, &base->object->id);
|
||||
|
@ -147,7 +147,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_objects")) {
|
||||
if (CTX_data_equals(member, "selected_objects")) {
|
||||
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
|
||||
if (BASE_SELECTED(v3d, base)) {
|
||||
CTX_data_id_list_add(result, &base->object->id);
|
||||
|
@ -156,7 +156,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_editable_objects")) {
|
||||
if (CTX_data_equals(member, "selected_editable_objects")) {
|
||||
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
|
||||
if (BASE_SELECTED_EDITABLE(v3d, base)) {
|
||||
CTX_data_id_list_add(result, &base->object->id);
|
||||
|
@ -165,7 +165,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "editable_objects")) {
|
||||
if (CTX_data_equals(member, "editable_objects")) {
|
||||
/* Visible + Editable, but not necessarily selected */
|
||||
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
|
||||
if (BASE_EDITABLE(v3d, base)) {
|
||||
|
@ -175,7 +175,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "objects_in_mode")) {
|
||||
if (CTX_data_equals(member, "objects_in_mode")) {
|
||||
if (obact && (obact->mode != OB_MODE_OBJECT)) {
|
||||
FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, obact->type, obact->mode, ob_iter) {
|
||||
CTX_data_id_list_add(result, &ob_iter->id);
|
||||
|
@ -185,7 +185,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "objects_in_mode_unique_data")) {
|
||||
if (CTX_data_equals(member, "objects_in_mode_unique_data")) {
|
||||
if (obact && (obact->mode != OB_MODE_OBJECT)) {
|
||||
FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, obact->type, obact->mode, ob_iter) {
|
||||
ob_iter->id.tag |= LIB_TAG_DOIT;
|
||||
|
@ -202,7 +202,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION);
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) {
|
||||
if (CTX_data_equals(member, "visible_bones") || CTX_data_equals(member, "editable_bones")) {
|
||||
bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
|
||||
EditBone *ebone, *flipbone = NULL;
|
||||
const bool editable_bones = CTX_data_equals(member, "editable_bones");
|
||||
|
@ -259,8 +259,8 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_bones") ||
|
||||
CTX_data_equals(member, "selected_editable_bones")) {
|
||||
if (CTX_data_equals(member, "selected_bones") ||
|
||||
CTX_data_equals(member, "selected_editable_bones")) {
|
||||
bArmature *arm = (obedit && obedit->type == OB_ARMATURE) ? obedit->data : NULL;
|
||||
EditBone *ebone, *flipbone = NULL;
|
||||
const bool selected_editable_bones = CTX_data_equals(member, "selected_editable_bones");
|
||||
|
@ -317,7 +317,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "visible_pose_bones")) {
|
||||
if (CTX_data_equals(member, "visible_pose_bones")) {
|
||||
Object *obpose = BKE_object_pose_armature_get(obact);
|
||||
if (obpose && obpose->pose && obpose->data) {
|
||||
if (obpose != obact) {
|
||||
|
@ -340,7 +340,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_pose_bones")) {
|
||||
if (CTX_data_equals(member, "selected_pose_bones")) {
|
||||
Object *obpose = BKE_object_pose_armature_get(obact);
|
||||
if (obpose && obpose->pose && obpose->data) {
|
||||
if (obpose != obact) {
|
||||
|
@ -363,7 +363,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_pose_bones_from_active_object")) {
|
||||
if (CTX_data_equals(member, "selected_pose_bones_from_active_object")) {
|
||||
Object *obpose = BKE_object_pose_armature_get(obact);
|
||||
if (obpose && obpose->pose && obpose->data) {
|
||||
if (obpose != obact) {
|
||||
|
@ -383,7 +383,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_bone")) {
|
||||
if (CTX_data_equals(member, "active_bone")) {
|
||||
if (obact && obact->type == OB_ARMATURE) {
|
||||
bArmature *arm = obact->data;
|
||||
if (arm->edbo) {
|
||||
|
@ -401,7 +401,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_pose_bone")) {
|
||||
if (CTX_data_equals(member, "active_pose_bone")) {
|
||||
bPoseChannel *pchan;
|
||||
Object *obpose = BKE_object_pose_armature_get(obact);
|
||||
|
||||
|
@ -412,21 +412,21 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_object")) {
|
||||
if (CTX_data_equals(member, "active_object")) {
|
||||
if (obact) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "object")) {
|
||||
if (CTX_data_equals(member, "object")) {
|
||||
if (obact) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "edit_object")) {
|
||||
if (CTX_data_equals(member, "edit_object")) {
|
||||
/* convenience for now, 1 object per scene in editmode */
|
||||
if (obedit) {
|
||||
CTX_data_id_pointer_set(result, &obedit->id);
|
||||
|
@ -434,42 +434,42 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "sculpt_object")) {
|
||||
if (CTX_data_equals(member, "sculpt_object")) {
|
||||
if (obact && (obact->mode & OB_MODE_SCULPT)) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "vertex_paint_object")) {
|
||||
if (CTX_data_equals(member, "vertex_paint_object")) {
|
||||
if (obact && (obact->mode & OB_MODE_VERTEX_PAINT)) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "weight_paint_object")) {
|
||||
if (CTX_data_equals(member, "weight_paint_object")) {
|
||||
if (obact && (obact->mode & OB_MODE_WEIGHT_PAINT)) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "image_paint_object")) {
|
||||
if (CTX_data_equals(member, "image_paint_object")) {
|
||||
if (obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "particle_edit_object")) {
|
||||
if (CTX_data_equals(member, "particle_edit_object")) {
|
||||
if (obact && (obact->mode & OB_MODE_PARTICLE_EDIT)) {
|
||||
CTX_data_id_pointer_set(result, &obact->id);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (CTX_data_equals(member, "pose_object")) {
|
||||
if (CTX_data_equals(member, "pose_object")) {
|
||||
Object *obpose = BKE_object_pose_armature_get(obact);
|
||||
if (obpose) {
|
||||
CTX_data_id_pointer_set(result, &obpose->id);
|
||||
|
@ -477,7 +477,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
return 1;
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "sequences")) {
|
||||
if (CTX_data_equals(member, "sequences")) {
|
||||
Editing *ed = BKE_sequencer_editing_get(scene, false);
|
||||
if (ed) {
|
||||
Sequence *seq;
|
||||
|
@ -489,7 +489,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_sequences")) {
|
||||
if (CTX_data_equals(member, "selected_sequences")) {
|
||||
Editing *ed = BKE_sequencer_editing_get(scene, false);
|
||||
if (ed) {
|
||||
Sequence *seq;
|
||||
|
@ -503,7 +503,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_editable_sequences")) {
|
||||
if (CTX_data_equals(member, "selected_editable_sequences")) {
|
||||
Editing *ed = BKE_sequencer_editing_get(scene, false);
|
||||
if (ed) {
|
||||
Sequence *seq;
|
||||
|
@ -517,7 +517,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "selected_nla_strips")) {
|
||||
if (CTX_data_equals(member, "selected_nla_strips")) {
|
||||
bAnimContext ac;
|
||||
if (ANIM_animdata_get_context(C, &ac) != 0) {
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
|
@ -543,7 +543,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "gpencil_data")) {
|
||||
if (CTX_data_equals(member, "gpencil_data")) {
|
||||
/* FIXME: for some reason, CTX_data_active_object(C) returns NULL when called from these
|
||||
* situations (as outlined above - see Campbell's #ifdefs).
|
||||
* That causes the get_active function to fail when called from context.
|
||||
|
@ -557,7 +557,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "gpencil_data_owner")) {
|
||||
if (CTX_data_equals(member, "gpencil_data_owner")) {
|
||||
/* Pointer to which data/datablock owns the reference to the Grease Pencil data being used
|
||||
* (as gpencil_data). */
|
||||
bGPdata **gpd_ptr = NULL;
|
||||
|
@ -572,7 +572,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "annotation_data")) {
|
||||
if (CTX_data_equals(member, "annotation_data")) {
|
||||
bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)screen, area, scene);
|
||||
|
||||
if (gpd) {
|
||||
|
@ -581,7 +581,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "annotation_data_owner")) {
|
||||
if (CTX_data_equals(member, "annotation_data_owner")) {
|
||||
/* Pointer to which data/datablock owns the reference to the Grease Pencil data being used. */
|
||||
bGPdata **gpd_ptr = NULL;
|
||||
PointerRNA ptr;
|
||||
|
@ -595,7 +595,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_gpencil_layer")) {
|
||||
if (CTX_data_equals(member, "active_gpencil_layer")) {
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
|
||||
|
||||
if (gpd) {
|
||||
|
@ -608,7 +608,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_annotation_layer")) {
|
||||
if (CTX_data_equals(member, "active_annotation_layer")) {
|
||||
bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)screen, area, scene);
|
||||
|
||||
if (gpd) {
|
||||
|
@ -621,7 +621,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_gpencil_frame")) {
|
||||
if (CTX_data_equals(member, "active_gpencil_frame")) {
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
|
||||
|
||||
if (gpd) {
|
||||
|
@ -634,7 +634,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "visible_gpencil_layers")) {
|
||||
if (CTX_data_equals(member, "visible_gpencil_layers")) {
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
|
||||
|
||||
if (gpd) {
|
||||
|
@ -650,7 +650,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "editable_gpencil_layers")) {
|
||||
if (CTX_data_equals(member, "editable_gpencil_layers")) {
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
|
||||
|
||||
if (gpd) {
|
||||
|
@ -666,7 +666,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "editable_gpencil_strokes")) {
|
||||
if (CTX_data_equals(member, "editable_gpencil_strokes")) {
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_direct(area, obact);
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
|
||||
|
@ -707,7 +707,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_operator")) {
|
||||
if (CTX_data_equals(member, "active_operator")) {
|
||||
wmOperator *op = NULL;
|
||||
|
||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||
|
@ -730,10 +730,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "editable_fcurves") ||
|
||||
CTX_data_equals(member, "visible_fcurves") ||
|
||||
CTX_data_equals(member, "selected_editable_fcurves") ||
|
||||
CTX_data_equals(member, "selected_visible_fcurves")) {
|
||||
if (CTX_data_equals(member, "editable_fcurves") || CTX_data_equals(member, "visible_fcurves") ||
|
||||
CTX_data_equals(member, "selected_editable_fcurves") ||
|
||||
CTX_data_equals(member, "selected_visible_fcurves")) {
|
||||
bAnimContext ac;
|
||||
|
||||
if (ANIM_animdata_get_context(C, &ac) && ELEM(ac.spacetype, SPACE_ACTION, SPACE_GRAPH)) {
|
||||
|
@ -765,7 +764,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else if (CTX_data_equals(member, "active_editable_fcurve")) {
|
||||
if (CTX_data_equals(member, "active_editable_fcurve")) {
|
||||
bAnimContext ac;
|
||||
|
||||
if (ANIM_animdata_get_context(C, &ac) && ELEM(ac.spacetype, SPACE_GRAPH)) {
|
||||
|
@ -788,9 +787,6 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||
}
|
||||
return -1; /* found but not available */
|
||||
}
|
||||
else {
|
||||
return 0; /* not found */
|
||||
}
|
||||
|
||||
return -1; /* found but not available */
|
||||
return 0; /* not found */
|
||||
}
|
||||
|
|
|
@ -327,27 +327,26 @@ short screen_geom_find_area_split_point(const ScrArea *area,
|
|||
|
||||
return y;
|
||||
}
|
||||
else {
|
||||
x = area->v1->vec.x + round_fl_to_short(fac * cur_area_width);
|
||||
|
||||
area_min = area_min_x;
|
||||
x = area->v1->vec.x + round_fl_to_short(fac * cur_area_width);
|
||||
|
||||
if (area->v1->vec.x > window_rect->xmin) {
|
||||
area_min += U.pixelsize;
|
||||
}
|
||||
if (area->v4->vec.x < (window_rect->xmax - 1)) {
|
||||
area_min += U.pixelsize;
|
||||
}
|
||||
area_min = area_min_x;
|
||||
|
||||
if (x - area->v1->vec.x < area_min) {
|
||||
x = area->v1->vec.x + area_min;
|
||||
}
|
||||
else if (area->v4->vec.x - x < area_min) {
|
||||
x = area->v4->vec.x - area_min;
|
||||
}
|
||||
|
||||
return x;
|
||||
if (area->v1->vec.x > window_rect->xmin) {
|
||||
area_min += U.pixelsize;
|
||||
}
|
||||
if (area->v4->vec.x < (window_rect->xmax - 1)) {
|
||||
area_min += U.pixelsize;
|
||||
}
|
||||
|
||||
if (x - area->v1->vec.x < area_min) {
|
||||
x = area->v1->vec.x + area_min;
|
||||
}
|
||||
else if (area->v4->vec.x - x < area_min) {
|
||||
x = area->v4->vec.x - area_min;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -260,9 +260,7 @@ bool ED_operator_outliner_active_no_editobject(bContext *C)
|
|||
if (ob && ob == obedit) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -762,10 +760,10 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b
|
|||
if (az->type == AZONE_AREA) {
|
||||
break;
|
||||
}
|
||||
else if (az->type == AZONE_REGION) {
|
||||
if (az->type == AZONE_REGION) {
|
||||
break;
|
||||
}
|
||||
else if (az->type == AZONE_FULLSCREEN) {
|
||||
if (az->type == AZONE_FULLSCREEN) {
|
||||
rcti click_rect;
|
||||
fullscreen_click_rcti_init(&click_rect, az->x1, az->y1, az->x2, az->y2);
|
||||
const bool click_isect = BLI_rcti_isect_pt_v(&click_rect, xy);
|
||||
|
@ -997,14 +995,13 @@ static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
actionzone_exit(op);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
BLI_assert(ELEM(sad->az->type, AZONE_AREA, AZONE_REGION_SCROLL));
|
||||
|
||||
/* add modal handler */
|
||||
G.moving |= G_TRANSFORM_WM;
|
||||
WM_event_add_modal_handler(C, op);
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
BLI_assert(ELEM(sad->az->type, AZONE_AREA, AZONE_REGION_SCROLL));
|
||||
|
||||
/* add modal handler */
|
||||
G.moving |= G_TRANSFORM_WM;
|
||||
WM_event_add_modal_handler(C, op);
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
|
||||
static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
@ -1392,9 +1389,7 @@ finally:
|
|||
if (newwin) {
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_area_dupli(wmOperatorType *ot)
|
||||
|
@ -1492,21 +1487,21 @@ static void area_move_set_limits(wmWindow *win,
|
|||
return;
|
||||
}
|
||||
/* top edge */
|
||||
else if ((area->v2->editflag && area->v3->editflag)) {
|
||||
if ((area->v2->editflag && area->v3->editflag)) {
|
||||
*smaller = area->v1->vec.y + size_min;
|
||||
*bigger = area->v1->vec.y + size_max;
|
||||
*use_bigger_smaller_snap = true;
|
||||
return;
|
||||
}
|
||||
/* right edge */
|
||||
else if ((area->v3->editflag && area->v4->editflag)) {
|
||||
if ((area->v3->editflag && area->v4->editflag)) {
|
||||
*smaller = area->v1->vec.x + size_min;
|
||||
*bigger = area->v1->vec.x + size_max;
|
||||
*use_bigger_smaller_snap = true;
|
||||
return;
|
||||
}
|
||||
/* lower edge */
|
||||
else if ((area->v4->editflag && area->v1->editflag)) {
|
||||
if ((area->v4->editflag && area->v1->editflag)) {
|
||||
*smaller = area->v2->vec.y - size_max;
|
||||
*bigger = area->v2->vec.y - size_min;
|
||||
*use_bigger_smaller_snap = true;
|
||||
|
@ -2046,13 +2041,13 @@ static ScrEdge *area_findsharededge(bScreen *screen, ScrArea *area, ScrArea *sb)
|
|||
if (sav1 == sbv4 && sav2 == sbv3) { /* area to right of sb = W */
|
||||
return BKE_screen_find_edge(screen, sav1, sav2);
|
||||
}
|
||||
else if (sav2 == sbv1 && sav3 == sbv4) { /* area to bottom of sb = N */
|
||||
if (sav2 == sbv1 && sav3 == sbv4) { /* area to bottom of sb = N */
|
||||
return BKE_screen_find_edge(screen, sav2, sav3);
|
||||
}
|
||||
else if (sav3 == sbv2 && sav4 == sbv1) { /* area to left of sb = E */
|
||||
if (sav3 == sbv2 && sav4 == sbv1) { /* area to left of sb = E */
|
||||
return BKE_screen_find_edge(screen, sav3, sav4);
|
||||
}
|
||||
else if (sav1 == sbv2 && sav4 == sbv3) { /* area on top of sb = S*/
|
||||
if (sav1 == sbv2 && sav4 == sbv3) { /* area on top of sb = S*/
|
||||
return BKE_screen_find_edge(screen, sav1, sav4);
|
||||
}
|
||||
|
||||
|
@ -3028,15 +3023,14 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
|
|||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else {
|
||||
areas_do_frame_follow(C, true);
|
||||
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK);
|
||||
areas_do_frame_follow(C, true);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
|
||||
|
@ -3092,17 +3086,16 @@ static int marker_jump_exec(bContext *C, wmOperator *op)
|
|||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else {
|
||||
CFRA = closest;
|
||||
|
||||
areas_do_frame_follow(C, true);
|
||||
CFRA = closest;
|
||||
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK);
|
||||
areas_do_frame_follow(C, true);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_marker_jump(wmOperatorType *ot)
|
||||
|
@ -3366,10 +3359,8 @@ static int area_join_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
if (sad->sa1 == sad->sa2) {
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
else {
|
||||
if (!area_join_init(C, op, sad->sa1, sad->sa2)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if (!area_join_init(C, op, sad->sa1, sad->sa2)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3677,9 +3668,7 @@ static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
if (lastop->type->flag & OPTYPE_REGISTER) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
lastop = lastop->prev;
|
||||
}
|
||||
lastop = lastop->prev;
|
||||
}
|
||||
|
||||
if (lastop) {
|
||||
|
@ -4391,7 +4380,7 @@ static void screen_animation_region_tag_redraw(ScrArea *area,
|
|||
ED_region_tag_redraw(region);
|
||||
return;
|
||||
}
|
||||
else if (scene->r.cfra > region->v2d.cur.xmax) {
|
||||
if (scene->r.cfra > region->v2d.cur.xmax) {
|
||||
region->v2d.cur.xmin = scene->r.cfra;
|
||||
region->v2d.cur.xmax = region->v2d.cur.xmin + w;
|
||||
ED_region_tag_redraw(region);
|
||||
|
@ -4916,10 +4905,8 @@ static int userpref_show_exec(bContext *C, wmOperator *op)
|
|||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_userpref_show(struct wmOperatorType *ot)
|
||||
|
@ -4994,10 +4981,8 @@ static int drivers_editor_show_exec(bContext *C, wmOperator *op)
|
|||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_drivers_editor_show(struct wmOperatorType *ot)
|
||||
|
@ -5038,10 +5023,8 @@ static int info_log_show_exec(bContext *C, wmOperator *op)
|
|||
false) != NULL) {
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_info_log_show(struct wmOperatorType *ot)
|
||||
|
|
|
@ -91,10 +91,8 @@ static int screenshot_data_create(bContext *C, wmOperator *op)
|
|||
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
op->customdata = NULL;
|
||||
return false;
|
||||
}
|
||||
op->customdata = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void screenshot_data_free(wmOperator *op)
|
||||
|
|
Loading…
Reference in New Issue