summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSavely Skresanov <savask@yandex.ru>2012-05-28 14:18:29 (GMT)
committer Savely Skresanov <savask@yandex.ru>2012-05-28 14:20:21 (GMT)
commit274a7fe58262c3053d2027f353b3d8290c451cb2 (patch)
treee13ca3357c6af579adbd56a8bf95d5dae85ac126 /src
parentb6d813a54d5cf6548d55384f81946f877cc20e1e (diff)
downloadpowder-274a7fe58262c3053d2027f353b3d8290c451cb2.zip
powder-274a7fe58262c3053d2027f353b3d8290c451cb2.tar.gz
No rounding errors with triangle brush, so no need for epsilon (I hope).
Diffstat (limited to 'src')
-rw-r--r--src/powder.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/powder.c b/src/powder.c
index 3861248..83a180a 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -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;