Cleanup: Make format
This commit is contained in:
@@ -783,14 +783,15 @@ static void bb_combineMaps(FluidObjectBB *output,
|
||||
x - bb2->min[0], bb2->res[0], y - bb2->min[1], bb2->res[1], z - bb2->min[2]);
|
||||
|
||||
/* Values. */
|
||||
output->numobjs[index_out] = std::max(bb2->numobjs[index_in], output->numobjs[index_out]);
|
||||
output->numobjs[index_out] = std::max(bb2->numobjs[index_in],
|
||||
output->numobjs[index_out]);
|
||||
if (output->influence && bb2->influence) {
|
||||
if (additive) {
|
||||
output->influence[index_out] += bb2->influence[index_in] * sample_size;
|
||||
}
|
||||
else {
|
||||
output->influence[index_out] = std::max(bb2->influence[index_in],
|
||||
output->influence[index_out]);
|
||||
output->influence[index_out]);
|
||||
}
|
||||
}
|
||||
output->distances[index_out] = MIN2(bb2->distances[index_in],
|
||||
|
||||
@@ -383,7 +383,7 @@ static void bm_uuidwalk_rehash(UUIDWalk *uuidwalk)
|
||||
uint i;
|
||||
|
||||
uint rehash_store_len_new = std::max(BLI_ghash_len(uuidwalk->verts_uuid),
|
||||
BLI_ghash_len(uuidwalk->faces_uuid));
|
||||
BLI_ghash_len(uuidwalk->faces_uuid));
|
||||
|
||||
bm_uuidwalk_rehash_reserve(uuidwalk, rehash_store_len_new);
|
||||
uuid_store = uuidwalk->cache.rehash_store;
|
||||
|
||||
@@ -997,8 +997,9 @@ void MathCompareOperation::execute_pixel_sampled(float output[4],
|
||||
input_value2_operation_->read_sampled(input_value2, x, y, sampler);
|
||||
input_value3_operation_->read_sampled(input_value3, x, y, sampler);
|
||||
|
||||
output[0] = (fabsf(input_value1[0] - input_value2[0]) <= std::max(input_value3[0], 1e-5f)) ? 1.0f :
|
||||
0.0f;
|
||||
output[0] = (fabsf(input_value1[0] - input_value2[0]) <= std::max(input_value3[0], 1e-5f)) ?
|
||||
1.0f :
|
||||
0.0f;
|
||||
|
||||
clamp_if_needed(output);
|
||||
}
|
||||
|
||||
@@ -1121,7 +1121,8 @@ static void ui_draw_colorband_handle(uint shdr_pos,
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
|
||||
/* Allow the lines to decrease as we get really small. */
|
||||
float line_width = std::max(std::min(U.pixelsize / 5.0f * fabs(half_width - 4.0f), U.pixelsize), 0.5f);
|
||||
float line_width = std::max(std::min(U.pixelsize / 5.0f * fabs(half_width - 4.0f), U.pixelsize),
|
||||
0.5f);
|
||||
|
||||
/* Make things transparent as we get tiny. */
|
||||
uchar alpha = std::min(int(fabs(half_width - 2.0f) * 50.0f), 255);
|
||||
|
||||
@@ -103,10 +103,10 @@ static int textview_wrap_offsets(
|
||||
|
||||
*r_lines = 1;
|
||||
|
||||
*r_offsets = static_cast<int *>(
|
||||
MEM_callocN(sizeof(**r_offsets) *
|
||||
(str_len * column_width_max / std::max(1, width - (column_width_max - 1)) + 1),
|
||||
__func__));
|
||||
*r_offsets = static_cast<int *>(MEM_callocN(
|
||||
sizeof(**r_offsets) *
|
||||
(str_len * column_width_max / std::max(1, width - (column_width_max - 1)) + 1),
|
||||
__func__));
|
||||
(*r_offsets)[0] = 0;
|
||||
|
||||
for (i = 0, end = width, j = 0; j < str_len && str[j]; j += BLI_str_utf8_size_safe(str + j)) {
|
||||
|
||||
@@ -2203,7 +2203,7 @@ ImBuf *imb_load_filepath_thumbnail_openexr(const char *filepath,
|
||||
}
|
||||
|
||||
float scale_factor = std::min(float(max_thumb_size) / float(source_w),
|
||||
float(max_thumb_size) / float(source_h));
|
||||
float(max_thumb_size) / float(source_h));
|
||||
int dest_w = std::max(int(source_w * scale_factor), 1);
|
||||
int dest_h = std::max(int(source_h * scale_factor), 1);
|
||||
|
||||
|
||||
@@ -387,11 +387,11 @@ static void panel_draw(const bContext *C, Panel *panel)
|
||||
if (ob_use_adaptive_subdivision && show_adaptive_options) {
|
||||
uiItemR(layout, &ob_cycles_ptr, "dicing_rate", UI_ITEM_NONE, nullptr, ICON_NONE);
|
||||
float render = std::max(RNA_float_get(&cycles_ptr, "dicing_rate") *
|
||||
RNA_float_get(&ob_cycles_ptr, "dicing_rate"),
|
||||
0.1f);
|
||||
RNA_float_get(&ob_cycles_ptr, "dicing_rate"),
|
||||
0.1f);
|
||||
float preview = std::max(RNA_float_get(&cycles_ptr, "preview_dicing_rate") *
|
||||
RNA_float_get(&ob_cycles_ptr, "dicing_rate"),
|
||||
0.1f);
|
||||
RNA_float_get(&ob_cycles_ptr, "dicing_rate"),
|
||||
0.1f);
|
||||
char output[256];
|
||||
SNPRINTF(output, TIP_("Final Scale: Render %.2f px, Viewport %.2f px"), render, preview);
|
||||
uiItemL(layout, output, ICON_NONE);
|
||||
|
||||
Reference in New Issue
Block a user