shithub: slug

Download patch

ref: 9dc192ff25b54550a4cdb092d30c8be55475af5f
parent: 5162f45598611d2a81f420acede1d2f64a10a9c5
author: phil9 <[email protected]>
date: Fri Dec 2 04:42:58 EST 2022

make arc() accept radians instead of degrees for angles

	this makes the API uniform across all functions taking angle parameters

--- a/api.c
+++ b/api.c
@@ -341,8 +341,8 @@
 	y = luaL_checkinteger(L, 2);
 	a = luaL_checkinteger(L, 3);
 	b = luaL_checkinteger(L, 4);
-	c = luaL_checkinteger(L, 5);
-	d = luaL_checkinteger(L, 6);
+	c = luaL_checknumber(L, 5) * 180.0/PI;
+	d = luaL_checknumber(L, 6) * 180.0/PI;
 	p = canvaspt(x, y);
 	if(!nofill)
 		fillarc(canvas, p, a, b, fill, ZP, c, d);