shithub: slug

Download patch

ref: 5162f45598611d2a81f420acede1d2f64a10a9c5
parent: 2c2a11db8b8e6c7243050854c4dbca226966f12b
author: phil9 <telephil9@gmail.com>
date: Fri Dec 2 04:37:55 EST 2022

make transformations cumulative (i.e. add to current state instead of simply setting value)

	this replicates Processing behaviour.

--- a/api.c
+++ b/api.c
@@ -408,7 +408,7 @@
 
 	x = luaL_checkinteger(L, 1);
 	y = luaL_checkinteger(L, 2);
-	origin = Pt(x, y);
+	origin = addpt(origin, Pt(x, y));
 	return 0;
 }
 
@@ -415,7 +415,7 @@
 int
 crotate(lua_State *L)
 {
-	angle = luaL_checknumber(L, 1);
+	angle += luaL_checknumber(L, 1);
 	return 0;
 }