Also, just added your ellipse code. I modified it so that it takes x1,y1,x2,y2 so that it can be called in the same way as fill/drawRect - it also works better with graphicsToDeviceCoordinates because as it was it would have broken when used with rotated screens.
Also - and this one's my fault - because you can now specify the bounding rect you can effectively ask it to draw something that doesn't have an integer radius. I don't know if that's something that can easily be fixed with that algorithm? No worries if not :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Also, just added your ellipse code. I modified it so that it takes x1,y1,x2,y2 so that it can be called in the same way as fill/drawRect - it also works better with
graphicsToDeviceCoordinates
because as it was it would have broken when used with rotated screens.However, it seems there are some issues... I'd expected that
drawEllipse
with width and height the same would draw something that looked the same if you rotated it by 90 degrees - that doesn't seem to be the case?https://github.com/espruino/Espruino/blob/master/tests/test_graphics_ellipse.js#L22
Also - and this one's my fault - because you can now specify the bounding rect you can effectively ask it to draw something that doesn't have an integer radius. I don't know if that's something that can easily be fixed with that algorithm? No worries if not :)