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:
authorAntony Riakiotakis <kalast@gmail.com>2015-01-29 19:45:36 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-01-29 19:45:43 +0300
commita0e8b98b6102ac19f0724b390d9decbc077fcf8f (patch)
tree3bc0d1e5215aadfddbb6a4b4dbf97a18c9f6179a
parent43fab448f31b910409f03e1d9c1a2d74135a2b16 (diff)
Fix T43207 fill brush fails in perspective mode
Divide only the length of the edge by the homogenous coordinate, not the final coordinate. Also fix the swapping (though it's still a bit doubtfull if it's really needed)
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c8
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]);
}