-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yboichuk/lua/draw image transformed #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Виглядає супер! Треба тільки деякі незначні зміни.
@@ -253,6 +254,72 @@ int lualilka_display_drawImage(lua_State* L) { | |||
return 0; | |||
}; | |||
|
|||
int lualilka_display_drawImageTransformed(lua_State* L) { | |||
// Args are image table, X & Y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут 4 аргументи
lilka::Transform& transform = *reinterpret_cast<lilka::Transform*>(luaL_checkudata(L, 4, IMAGE_TRANSFORM)); | ||
|
||
// Calculate the coordinates of the four corners of the destination rectangle. | ||
lilka::int_vector_t v1 = transform.transform(lilka::int_vector_t{-image->pivotX, -image->pivotY}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чи є якась причина дублювання цього коду? Він же вже є в lilka::Canvas
, можна просто поміняти сигнатуру getDrawable
, щоб вона повертала lilka::Canvas*
замість Arduino_GFX*
.
Супер! |
Add interface beetween cpp lilka::Transform class and lua api, add function to lualilka_display.cpp what can draw image with transform.