diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-12 04:35:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-12 04:35:31 +0400 |
commit | 533f359c0d2587659566877fee7135d8c9828c06 (patch) | |
tree | bfd21f0edd600e9f9df204d956363e190d795112 /source/blender/editors/uvedit | |
parent | fcbd9c3a332fda86c2fe9e8cf5ddfacf29b85419 (diff) |
code cleanup: some style edits, also allow mul_v2_m2v2() to have the same value as in-out, since this is a convention for existing matrix functions.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index b7e12dda663..5bb8105cd14 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -429,13 +429,18 @@ static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition } island_stitch_data[i].medianPoint[1] /= state->aspect; - if ((island_stitch_data[i].rotation + island_stitch_data[i].rotation_neg < M_PI_2) || - island_stitch_data[i].num_rot_elements == 0 || island_stitch_data[i].num_rot_elements_neg == 0) - rotation = (island_stitch_data[i].rotation*island_stitch_data[i].num_rot_elements - - island_stitch_data[i].rotation_neg*island_stitch_data[i].num_rot_elements_neg)/totelem; - else - rotation = (island_stitch_data[i].rotation*island_stitch_data[i].num_rot_elements + - (2*M_PI - island_stitch_data[i].rotation_neg)*island_stitch_data[i].num_rot_elements_neg)/totelem; + if ((island_stitch_data[i].rotation + island_stitch_data[i].rotation_neg < (float)M_PI_2) || + island_stitch_data[i].num_rot_elements == 0 || island_stitch_data[i].num_rot_elements_neg == 0) + { + rotation = (island_stitch_data[i].rotation * island_stitch_data[i].num_rot_elements - + island_stitch_data[i].rotation_neg * + island_stitch_data[i].num_rot_elements_neg) / totelem; + } + else { + rotation = (island_stitch_data[i].rotation * island_stitch_data[i].num_rot_elements + + (2.0f * (float)M_PI - island_stitch_data[i].rotation_neg) * + island_stitch_data[i].num_rot_elements_neg) / totelem; + } rotate_m2(rotation_mat, rotation); numOfIslandUVs = getNumOfIslandUvs(state->element_map, i); @@ -521,7 +526,8 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta if (edgesin > 0.0f) { island_stitch_data[element1->island].num_rot_elements++; island_stitch_data[element1->island].rotation += rotation; - } else { + } + else { island_stitch_data[element1->island].num_rot_elements_neg++; island_stitch_data[element1->island].rotation_neg += rotation; } |