fix regression: selection of beziers either by clicking close to the bezier line or to the control points
This commit is contained in:
parent
d3d0b78c08
commit
afefb18ee2
|
|
@ -58,9 +58,19 @@ static double find_closest_bezier(double mx, double my, double d, int c, int i,
|
||||||
double t, t1, tmp;
|
double t, t1, tmp;
|
||||||
double xp, yp, xp1, yp1;
|
double xp, yp, xp1, yp1;
|
||||||
double x0, x1, x2, y0, y1, y2;
|
double x0, x1, x2, y0, y1, y2;
|
||||||
double *x = xctx->poly[c][i].x;
|
double ds = xctx->cadhalfdotsize;
|
||||||
double *y = xctx->poly[c][i].y;
|
xPoly *p = &xctx->poly[c][i];
|
||||||
int points = xctx->poly[c][i].points;
|
int points = p->points;
|
||||||
|
double *x = p->x;
|
||||||
|
double *y = p->y;
|
||||||
|
|
||||||
|
for(b = 0; b < points; b++) {
|
||||||
|
if(POINTINSIDE(xctx->mousex, xctx->mousey, p->x[b] - ds, p->y[b] - ds,
|
||||||
|
p->x[b] + ds, p->y[b] + ds)) {
|
||||||
|
*l = i; d = ds / 2.0; *col = c;
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(b = 0; b < points - 2; b++) {
|
for(b = 0; b < points - 2; b++) {
|
||||||
if(points == 3) { /* 3 points: only one bezier */
|
if(points == 3) { /* 3 points: only one bezier */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue