diff options
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 34a10963050..cbfa53d2660 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -1989,8 +1989,8 @@ static void line_rect_clip( tmp = (is_ortho) ? 1.0f : (l1[3] + min * (l2[3] - l1[3])); - uv[0] = (uv1[0] + min * (uv2[0] - uv1[0])) / tmp; - uv[1] = (uv1[1] + min * (uv2[1] - uv1[1])) / tmp; + uv[0] = (uv1[0] + min / tmp * (uv2[0] - uv1[0])); + uv[1] = (uv1[1] + min / tmp * (uv2[1] - uv1[1])); } @@ -2076,8 +2076,8 @@ static void project_bucket_clip_face( /* at this point we have all uv points needed in a row. all that's needed is to invert them if necessary */ if (flip) { /* flip only to the middle of the array */ - int i, max = *tot / 2; - for (i = 0; i < max; i++) { + int i, max = *tot - 1, mid = *tot / 2; + for (i = 0; i < mid; i++) { SWAP(float, bucket_bounds_uv[i][0], bucket_bounds_uv[max - i][0]); SWAP(float, bucket_bounds_uv[i][1], bucket_bounds_uv[max - i][1]); } |