piecemeal icon indicating copy to clipboard operation
piecemeal copied to clipboard

Rect trace iterator

Open thomcc opened this issue 11 years ago • 1 comments

The _RectTracer class feels like a bit of a hack, but I don't think there's a way to write this without it (and without changing the signature of trace()).

Anyway, I think this also handles negative widths and heights better, as the old version wouldn't iterate over them at all. I didn't add a test case or mention the negative width/height thing because I'm not sure I understand how they're actually supposed to work if they have a negative width/height.

thomcc avatar Sep 21 '14 23:09 thomcc

Thanks for hacking on this!

I didn't add a test case or mention the negative width/height thing because I'm not sure I understand how they're actually supposed to work if they have a negative width/height.

I think Rect's constructors should just throw an ArgumentError if you give them negative dimensions.

munificent avatar Sep 27 '14 18:09 munificent