Cleanup: style

This commit is contained in:
2018-10-04 09:23:58 +10:00
parent a04155dd52
commit 971ab57c7d
5 changed files with 25 additions and 26 deletions

View File

@@ -346,7 +346,7 @@ static void unit_dual_convert(
double value, const bUnitCollection *usys,
bUnitDef const **r_unit_a, bUnitDef const **r_unit_b,
double *r_value_a, double *r_value_b,
const bUnitDef *main_unit)
const bUnitDef *main_unit)
{
const bUnitDef *unit;
if (main_unit) unit = main_unit;
@@ -500,25 +500,24 @@ static const bUnitDef *get_preferred_unit_if_used(int type, PreferredUnits units
int max_offset = usys->length - 1;
switch (type)
{
case B_UNIT_LENGTH:
case B_UNIT_AREA:
case B_UNIT_VOLUME:
if (units.length == USER_UNIT_ADAPTIVE) return NULL;
return usys->units + MIN2(units.length, max_offset);
case B_UNIT_MASS:
if (units.mass == USER_UNIT_ADAPTIVE) return NULL;
return usys->units + MIN2(units.mass, max_offset);
case B_UNIT_TIME:
if (units.time == USER_UNIT_ADAPTIVE) return NULL;
return usys->units + MIN2(units.time, max_offset);
case B_UNIT_ROTATION:
if (units.rotation == 0) return usys->units + 0;
else if (units.rotation == USER_UNIT_ROT_RADIANS) return usys->units + 3;
break;
default:
break;
switch (type) {
case B_UNIT_LENGTH:
case B_UNIT_AREA:
case B_UNIT_VOLUME:
if (units.length == USER_UNIT_ADAPTIVE) return NULL;
return usys->units + MIN2(units.length, max_offset);
case B_UNIT_MASS:
if (units.mass == USER_UNIT_ADAPTIVE) return NULL;
return usys->units + MIN2(units.mass, max_offset);
case B_UNIT_TIME:
if (units.time == USER_UNIT_ADAPTIVE) return NULL;
return usys->units + MIN2(units.time, max_offset);
case B_UNIT_ROTATION:
if (units.rotation == 0) return usys->units + 0;
else if (units.rotation == USER_UNIT_ROT_RADIANS) return usys->units + 3;
break;
default:
break;
}
return NULL;
}
@@ -964,4 +963,4 @@ double bUnit_GetScaler(const void *usys_pt, int index)
bool bUnit_IsSuppressed(const void *usys_pt, int index)
{
return (((bUnitCollection *)usys_pt)->units[index].flag & B_UNIT_DEF_SUPPRESS) != 0;
}
}

View File

@@ -2764,7 +2764,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
case OB_GPENCIL:
/* in all modes except object mode hide always */
if ((OBACT(view_layer)) &&
(OBACT(view_layer)->mode != OB_MODE_OBJECT))
(OBACT(view_layer)->mode != OB_MODE_OBJECT))
{
break;
}

View File

@@ -357,7 +357,7 @@ static void dial_draw_intern(
}
if (draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE &&
(gz->flag & WM_GIZMO_DRAW_VALUE))
(gz->flag & WM_GIZMO_DRAW_VALUE))
{
DialInteraction *inter = gz->interaction_data;
if (inter) {

View File

@@ -1283,8 +1283,8 @@ void drawDial3d(const TransInfo *t)
scale *= ED_view3d_pixel_size_no_ui_scale(t->ar->regiondata, mat_final[3]);
mul_mat3_m4_fl(mat_final, scale);
if ((t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID))
&& activeSnap(t))
if ((t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)) &&
activeSnap(t))
{
increment = (t->modifiers & MOD_PRECISION) ? t->snap[2] : t->snap[1];
}

View File

@@ -556,7 +556,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
}
else {
n->val_flag[idx] |= NUM_INVALID;
}
}
#ifdef USE_FAKE_EDIT