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:
Diffstat (limited to 'source/blender/blenlib/intern/lasso.c')
-rw-r--r--source/blender/blenlib/intern/lasso.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/lasso.c b/source/blender/blenlib/intern/lasso.c
index aa08a780394..e89f7fd795b 100644
--- a/source/blender/blenlib/intern/lasso.c
+++ b/source/blender/blenlib/intern/lasso.c
@@ -34,12 +34,13 @@
#include "BLI_math.h"
#include "BLI_rect.h"
+#include "BLI_strict_flags.h"
#include "BLI_lasso.h" /* own include */
-void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const short moves)
+void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const unsigned int moves)
{
- short a;
+ unsigned int a;
rect->xmin = rect->xmax = mcords[0][0];
rect->ymin = rect->ymax = mcords[0][1];
@@ -53,28 +54,28 @@ void BLI_lasso_boundbox(rcti *rect, const int mcords[][2], const short moves)
}
-bool BLI_lasso_is_point_inside(const int mcords[][2], const short moves,
+bool BLI_lasso_is_point_inside(const int mcords[][2], const unsigned int moves,
const int sx, const int sy,
const int error_value)
{
- if (sx == error_value) {
+ if (sx == error_value || moves == 0) {
return false;
}
else {
int pt[2] = {sx, sy};
- return isect_point_poly_v2_int(pt, mcords, moves);
+ return isect_point_poly_v2_int(pt, mcords, moves, true);
}
}
/* edge version for lasso select. we assume boundbox check was done */
-bool BLI_lasso_is_edge_inside(const int mcords[][2], const short moves,
+bool BLI_lasso_is_edge_inside(const int mcords[][2], const unsigned int moves,
int x0, int y0, int x1, int y1,
const int error_value)
{
int v1[2], v2[2];
- int a;
+ unsigned int a;
- if (x0 == error_value || x1 == error_value) {
+ if (x0 == error_value || x1 == error_value || moves == 0) {
return false;
}