diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-07 02:48:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-07 02:48:28 +0400 |
commit | 3a0593cc3d5de33248b3a7b913a45729c37dc1b4 (patch) | |
tree | 88fcddc5e3c060c87a6313d853315f0efa484a52 /source/blender/editors/uvedit | |
parent | 2336aadb80f8602f001b2c5b0bcaacf3ad858f83 (diff) |
code cleanup: dont use function calls like dot_v3v3, pow and sqrt within macros which results in calling the function multiple times needlessly.
also added some comments.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 43f3e81ae92..5c2e57cf27f 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -403,7 +403,9 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta edgecos = uv1[0] * uv2[0] + uv1[1] * uv2[1]; edgesin = uv1[0] * uv2[1] - uv2[0] * uv1[1]; - rotation = (edgesin > 0.0f) ? acosf(MAX2(-1.0f, MIN2(1.0f, edgecos))) : -acosf(MAX2(-1.0f, MIN2(1.0f, edgecos))); + rotation = (edgesin > 0.0f) ? + +acosf(maxf(-1.0f, minf(1.0f, edgecos))) : + -acosf(maxf(-1.0f, minf(1.0f, edgecos))); island_stitch_data[element1->island].num_rot_elements++; island_stitch_data[element1->island].rotation += rotation; |