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:
authorCampbell Barton <ideasman42@gmail.com>2008-11-22 18:09:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-11-22 18:09:16 +0300
commitf747629133f2183aa9c09f2797bf350e01d43fa9 (patch)
tree683e3137407f07e9e68e85d1302e771396d9a4b0
parent923fb888d6284e16b5ef8b7c0c398438c8e9dd70 (diff)
maximum polyline between clipped rectangle and triangle was 6, but in some cases 7 points were set. set the maximum size of the polyline at 8 to be safe.
-rw-r--r--source/blender/src/imagepaint.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c
index c9ee8a1613b..69f233a13b9 100644
--- a/source/blender/src/imagepaint.c
+++ b/source/blender/src/imagepaint.c
@@ -1864,8 +1864,8 @@ static void project_bucket_clip_face(
/* Maximum possible 6 intersections when using a rectangle and triangle */
- float isectVCosSS[6][2];
- float isectVAngles[6];
+ float isectVCosSS[8][2];
+ float isectVAngles[8];
float vClipSS_A[2], vClipSS_B[2];
@@ -2054,7 +2054,7 @@ if __name__ == '__main__':
#endif
-int IsectPoly2Df(float pt[2], float uv[6][2], int tot)
+int IsectPoly2Df(float pt[2], float uv[8][2], int tot)
{
int i;
if (SIDE_OF_LINE(uv[tot-1],uv[0],pt) < 0.0f)
@@ -2109,7 +2109,7 @@ static void project_paint_face_init(ProjPaintState *ps, int thread_index, int bu
int i1,i2,i3;
- float uv_clip[6][2];
+ float uv_clip[8][2];
int uv_clip_tot;
vCo[0] = ps->dm_mvert[ (*(&mf->v1 )) ].co;
@@ -2166,6 +2166,11 @@ static void project_paint_face_init(ProjPaintState *ps, int thread_index, int bu
uv_clip, &uv_clip_tot
);
+ /* sometimes this happens, better just allow for 8 intersectiosn even though there should be max 6 */
+ /*
+ if (uv_clip_tot>6) {
+ printf("this should never happen! %d\n", uv_clip_tot);
+ }*/
if (pixel_bounds_array(uv_clip, min_px, max_px, ibuf->x, ibuf->y, uv_clip_tot )) {
@@ -2210,7 +2215,7 @@ static void project_paint_face_init(ProjPaintState *ps, int thread_index, int bu
has_x_isect = has_isect = 1;
} else if (has_x_isect) {
/* assuming the face is not a bow-tie - we know we cant intersect again on the X */
- //break;
+ break;
}
}