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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c11
3 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 0f5ebcf9f71..cac377c7e33 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -1350,7 +1350,7 @@ static void uv_image_outset(const ProjPaintState *ps,
if (tri_ang > 0.0f) {
const float dist = ps->seam_bleed_px * tanf(tri_ang);
- seam_data->corner_dist_sq[i] = SQUARE(dist);
+ seam_data->corner_dist_sq[i] = square_f(dist);
}
else {
seam_data->corner_dist_sq[i] = 0.0f;
@@ -5886,7 +5886,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
#ifndef PROJ_DEBUG_NOSEAMBLEED
/* pixel num to bleed */
ps->seam_bleed_px = settings->imapaint.seam_bleed;
- ps->seam_bleed_px_sq = SQUARE(settings->imapaint.seam_bleed);
+ ps->seam_bleed_px_sq = square_s(settings->imapaint.seam_bleed);
#endif
if (ps->do_mask_normal) {
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 72422770587..ee114d5f662 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -639,7 +639,7 @@ static bool paint_smooth_stroke(PaintStroke *stroke,
/* If the mouse is moving within the radius of the last move,
* don't update the mouse position. This allows sharp turns. */
- if (len_squared_v2v2(stroke->last_mouse_position, sample->mouse) < SQUARE(radius)) {
+ if (len_squared_v2v2(stroke->last_mouse_position, sample->mouse) < square_f(radius)) {
return false;
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 41bbaa94904..0fb5897628f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2364,7 +2364,7 @@ static PBVHNode **sculpt_pbvh_gather_generic(Object *ob,
SculptSearchSphereData data = {
.ss = ss,
.sd = sd,
- .radius_squared = SQUARE(ss->cache->radius * radius_scale),
+ .radius_squared = square_f(ss->cache->radius * radius_scale),
.original = use_original,
.ignore_fully_masked = brush->sculpt_tool != SCULPT_TOOL_MASK,
.center = NULL,
@@ -2378,7 +2378,8 @@ static PBVHNode **sculpt_pbvh_gather_generic(Object *ob,
SculptSearchCircleData data = {
.ss = ss,
.sd = sd,
- .radius_squared = ss->cache ? SQUARE(ss->cache->radius * radius_scale) : ss->cursor_radius,
+ .radius_squared = ss->cache ? square_f(ss->cache->radius * radius_scale) :
+ ss->cursor_radius,
.original = use_original,
.dist_ray_to_aabb_precalc = &dist_ray_to_aabb_precalc,
.ignore_fully_masked = brush->sculpt_tool != SCULPT_TOOL_MASK,
@@ -5710,7 +5711,7 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe
SculptSearchSphereData data = {
.ss = ss,
.sd = sd,
- .radius_squared = SQUARE(ss->cache->radius * (1.0 + brush->cloth_sim_limit)),
+ .radius_squared = square_f(ss->cache->radius * (1.0 + brush->cloth_sim_limit)),
.original = false,
.ignore_fully_masked = false,
.center = ss->cache->initial_location,
@@ -6795,7 +6796,7 @@ static void sculpt_update_brush_delta(UnifiedPaintSettings *ups, Object *ob, Bru
if ((normalize_v3(v2) > eps) && (normalize_v3(v1) > eps) &&
(len_squared_v3v3(v1, v2) > eps)) {
const float rake_dist_sq = len_squared_v3v3(cache->rake_data.follow_co, grab_location);
- const float rake_fade = (rake_dist_sq > SQUARE(cache->rake_data.follow_dist)) ?
+ const float rake_fade = (rake_dist_sq > square_f(cache->rake_data.follow_dist)) ?
1.0f :
sqrtf(rake_dist_sq) / cache->rake_data.follow_dist;
@@ -9780,7 +9781,7 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent *
copy_v2_v2(prevclick_f, op->customdata);
int prevclick[2] = {(int)prevclick_f[0], (int)prevclick_f[1]};
int len = (int)len_v2v2_int(prevclick, event->mval);
- len = ABS(len);
+ len = abs(len);
int mask_speed = RNA_int_get(op->ptr, "mask_speed");
int mask_expand_update_it = len / mask_speed;
mask_expand_update_it = mask_expand_update_it + 1;