mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 18:40:57 +00:00
[lua] Add GraphicsContext:oval() function
This commit is contained in:
parent
44729b27a7
commit
53c851c547
2
laf
2
laf
@ -1 +1 @@
|
||||
Subproject commit f59032bfcfbccedc107006ddca814f46ef0eb27f
|
||||
Subproject commit 511de99c370eb7bfd8cfdb1307dbef3bb2557c0d
|
@ -306,6 +306,14 @@ int GraphicsContext_cubicTo(lua_State* L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int GraphicsContext_oval(lua_State* L)
|
||||
{
|
||||
auto gc = get_obj<GraphicsContext>(L, 1);
|
||||
const gfx::Rect rc = convert_args_into_rect(L, 2);
|
||||
gc->oval(rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GraphicsContext_rect(lua_State* L)
|
||||
{
|
||||
auto gc = get_obj<GraphicsContext>(L, 1);
|
||||
@ -447,6 +455,7 @@ const luaL_Reg GraphicsContext_methods[] = {
|
||||
{ "moveTo", GraphicsContext_moveTo },
|
||||
{ "lineTo", GraphicsContext_lineTo },
|
||||
{ "cubicTo", GraphicsContext_cubicTo },
|
||||
{ "oval", GraphicsContext_oval },
|
||||
{ "rect", GraphicsContext_rect },
|
||||
{ "roundedRect", GraphicsContext_roundedRect },
|
||||
{ "stroke", GraphicsContext_stroke },
|
||||
|
@ -102,6 +102,9 @@ public:
|
||||
void cubicTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y) {
|
||||
m_path.cubicTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
||||
}
|
||||
void oval(const gfx::Rect& rc) {
|
||||
m_path.oval(rc);
|
||||
}
|
||||
void rect(const gfx::Rect& rc) {
|
||||
m_path.rect(rc);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user