No rounding errors with triangle brush, so no need for epsilon (I hope).
This commit is contained in:
parent
b6d813a54d
commit
274a7fe582
@ -3375,8 +3375,7 @@ int InCurrentBrush(int i, int j, int rx, int ry)
|
||||
return (abs(i) <= rx && abs(j) <= ry);
|
||||
break;
|
||||
case TRI_BRUSH:
|
||||
// -1e-9 because due to rounding errors, the corner at i=rx is not considered to be inside the brush at some brush sizes
|
||||
return (j <= ry ) && ( j >= (((-2.0*ry)/rx)*i)-ry-1e-9) && ( j >= (((-2.0*ry)/(-rx))*i)-ry-1e-9) ;
|
||||
return ((abs((rx+2*i)*ry+rx*j) + abs(2*rx*(j-ry)) + abs((rx-2*i)*ry+rx*j))<=(4*rx*ry));
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user