From 44505b38df557a5711703613685a1dec9fc2c3d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 Jun 2018 09:31:30 +0200 Subject: Cleanup: strip trailing space in editors --- source/blender/editors/sculpt_paint/paint_stroke.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c') diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index e6a9fd9adf8..afd24f0fe90 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -125,7 +125,7 @@ typedef struct PaintStroke { float zoom_2d; int pen_flip; - + /* line constraint */ bool constrain_line; float constrained_pos[2]; @@ -711,10 +711,10 @@ PaintStroke *paint_stroke_new(bContext *C, /* initialize here */ ups->overlap_factor = 1.0; ups->stroke_active = true; - + zero_v3(ups->average_stroke_accum); ups->average_stroke_counter = 0; - + /* initialize here to avoid initialization conflict with threaded strokes */ curvemapping_initialize(br->curve); if (p->flags & PAINT_USE_CAVITY_MASK) @@ -904,11 +904,11 @@ static void paint_stroke_sample_average(const PaintStroke *stroke, PaintSample *average) { int i; - + memset(average, 0, sizeof(*average)); BLI_assert(stroke->num_samples > 0); - + for (i = 0; i < stroke->num_samples; i++) { add_v2_v2(average->mouse, stroke->samples[i].mouse); average->pressure += stroke->samples[i].pressure; @@ -1072,17 +1072,17 @@ static void paint_stroke_line_constrain(PaintStroke *stroke, float mouse[2]) if (stroke->constrain_line) { float line[2]; float angle, len, res; - + sub_v2_v2v2(line, mouse, stroke->last_mouse_position); angle = atan2f(line[1], line[0]); len = len_v2(line); - + /* divide angle by PI/4 */ angle = 4.0f * angle / (float)M_PI; - + /* now take residue */ res = angle - floorf(angle); - + /* residue decides how close we are at a certain angle */ if (res <= 0.5f) { angle = floorf(angle) * (float)M_PI_4; @@ -1090,7 +1090,7 @@ static void paint_stroke_line_constrain(PaintStroke *stroke, float mouse[2]) else { angle = (floorf(angle) + 1.0f) * (float)M_PI_4; } - + mouse[0] = stroke->constrained_pos[0] = len * cosf(angle) + stroke->last_mouse_position[0]; mouse[1] = stroke->constrained_pos[1] = len * sinf(angle) + stroke->last_mouse_position[1]; } @@ -1185,12 +1185,12 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) else if (br->flag & BRUSH_LINE) { if (event->alt) stroke->constrain_line = true; - else + else stroke->constrain_line = false; copy_v2_fl2(mouse, event->mval[0], event->mval[1]); paint_stroke_line_constrain(stroke, mouse); - + if (stroke->stroke_started && (first_modal || (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)))) { if ((br->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || (br->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) { copy_v2_v2(stroke->ups->last_rake, stroke->last_mouse_position); -- cgit v1.2.3