madbence / node-bresenham

MIT License
66 stars 5 forks source link

Generator doesn't return correct values. #1

Closed rahatarmanahmed closed 8 years ago

rahatarmanahmed commented 8 years ago

Seems to only happen when used with two points with increasing y values.

$ node -v
v4.2.3
$ node
> var bre = require('bresenham')
undefined
> bre(4,0,4,1)
[ { x: 4, y: 0 }, { x: 4, y: 1 } ]
> bre = require('bresenham/generator')
[Function]
> b = bre(4,0,4,1)
{}
> b.next()
{ value: undefined, done: true }