ref: 183b9e5d39f5dbaf241859ea91d1e5e9c92e9186
parent: b15fb818047915f39d1b37032ff4f77146c8f4e6
author: phil9 <[email protected]>
date: Fri Dec 2 09:03:43 EST 2022
implement push() and pop() those are convenient helpers that do push (or pop) both matrix and style
--- a/api.c
+++ b/api.c
@@ -507,6 +507,22 @@
return 0;
}
+int
+cpush(lua_State *L)
+{
+ cpushmatrix(L);
+ cpushstyle(L);
+ return 0;
+}
+
+int
+cpop(lua_State *L)
+{
+ cpopmatrix(L);
+ cpopstyle(L);
+ return 0;
+}
+
void
registerfunc(lua_State *L, const char *name, int(*f)(lua_State*))
{
@@ -550,5 +566,7 @@
registerfunc(L, "popMatrix", cpopmatrix);
registerfunc(L, "pushStyle", cpushstyle);
registerfunc(L, "popStyle", cpopstyle);
+ registerfunc(L, "push", cpush);
+ registerfunc(L, "pop", cpop);
}