The problem is when the y value of the dot tested is between %y and %y + %h, regardless of the value of x. In your example the x value is always inside the circle while the y value changes, therefore it doesn't show the problem, switching to an horizontal line show the problem:

Code:
test {
  var %x = 10, %y = 10, %w = 50, %h = 50
  window -ap @test 100 100 100 100
  clear @test
  drawrect @test 3 1 %x %y %w %h
  drawrect -e @test 4 1 %x %y %w %h
  var %y2 = $calc(%y + (%h / 2))
  var %minx = %x - 5
  var %maxx = $calc(%x + %w + 5)
  var %x2 %minx
  while (%x2 <= %maxx) {
    var %e = $inellipse(%x2,%y2,%x,%y,%w,%h)
    echo 1 %x2 %y2 %e
    drawdot @test $iif(%e,4,1) 1 %x2 %y2
    inc %x2
  }
}
result: Note the two black dots at 10 35 and 60 35 and how almost every dot outside the circle from that line are wrongly reported as inside the circle, my first code and picture show the problem very well actually.

Last edited by Wims; 28/09/12 09:06 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel