From 5a69b93f57891d73379b731b52902ee47a34046d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Jun 2015 17:57:50 +1000 Subject: Sculpt lasso (used shorts for no good reason) --- source/blender/editors/sculpt_paint/paint_mask.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 25f22996050..2254bc991b6 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -290,7 +290,7 @@ typedef struct LassoMaskData { static bool is_effected_lasso(LassoMaskData *data, float co[3]) { float scr_co_f[2]; - short scr_co_s[2]; + int scr_co_s[2]; float co_final[3]; flip_v3_v3(co_final, co, data->symmpass); @@ -301,8 +301,13 @@ static bool is_effected_lasso(LassoMaskData *data, float co[3]) scr_co_s[1] = scr_co_f[1]; /* clip against screen, because lasso is limited to screen only */ - if (scr_co_s[0] < data->rect.xmin || scr_co_s[1] < data->rect.ymin || scr_co_s[0] >= data->rect.xmax || scr_co_s[1] >= data->rect.ymax) + if ((scr_co_s[0] < data->rect.xmin) || + (scr_co_s[1] < data->rect.ymin) || + (scr_co_s[0] >= data->rect.xmax) || + (scr_co_s[1] >= data->rect.ymax)) + { return false; + } scr_co_s[0] -= data->rect.xmin; scr_co_s[1] -= data->rect.ymin; -- cgit v1.2.3