$inellipse - 21/08/12 07:37 AM
$inellipse is returning wrong value ($true instead of $false) when the 'y' value of the dot tested is between the 'y' value of the circle and the 'y+h' value of that circle, regardless of the 'x' value of the dot tested:
Result: whereas only the dots inside the circle should be green
Code:
alias test { window -pBCdfo +t @a -1 -1 100 100 var %x 40,%y 40,%w 20,%h 20,%a 100,%b,%c while (%a) { %b = 100 while (%b) { %c = $iif($inellipse(%a,%b,%x,%y,%w,%h),64512,255) drawdot -r @a %c 1 %a %b dec %b } dec %a } ;$calc(1+%w) $calc(1+%h) to draw the circle correctly ;instead of being shifted because of the drawrect -e bug drawrect -re @a 0 1 %x %y $calc(1+%w) $calc(1+%h) }