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>2012-10-10 05:22:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-10 05:22:19 +0400
commitc3ca19800c199cfc35455c54310c2445ec4cac8f (patch)
tree32e049d2d65ea0c452ed404ae5158b98ff9e9cca /source/blender/editors/gpencil/gpencil_paint.c
parentd81d75b20d9aaff0e9139ea064d322cd9371d929 (diff)
refactor screen foreach functions to accept float[2] arguments rather then int pairs.
overall means less converting between float and int (and short in some cases).
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c07f0db7114..d0b48772d85 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -787,11 +787,16 @@ static short gp_stroke_eraser_strokeinside(const int mval[], const int UNUSED(mv
int rad, int x0, int y0, int x1, int y1)
{
/* simple within-radius check for now */
- if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1))
- return 1;
+ const float mval_fl[2] = {mval[0], mval[1]};
+ const float screen_co_a[2] = {x0, y0};
+ const float screen_co_b[2] = {x1, y1};
+
+ if (edge_inside_circle(mval_fl, rad, screen_co_a, screen_co_b)) {
+ return TRUE;
+ }
/* not inside */
- return 0;
+ return FALSE;
}
static void gp_point_to_xy(ARegion *ar, View2D *v2d, rctf *subrect, bGPDstroke *gps, bGPDspoint *pt,