Call luaL_checkstack to avoid memory errors
Add box_expand function
Shrink scissor to clip contents inside the border