Skip to content

Commit 0c21224

Browse files
committed
Fix lua resize message
1 parent 9b51819 commit 0c21224

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

Source/Objects/LuaObject.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -667,19 +667,6 @@ class LuaObject final : public ObjectBase
667667
repaint();
668668
return;
669669
}
670-
case hash("lua_resized"): {
671-
if (argc >= 2) {
672-
if (auto pdlua = ptr.get<t_pdlua>()) {
673-
pdlua->gfx.width = atom_getfloat(argv);
674-
pdlua->gfx.height = atom_getfloat(argv + 1);
675-
}
676-
MessageManager::callAsync([_object = SafePointer(object)] {
677-
if (_object)
678-
_object->updateBounds();
679-
});
680-
}
681-
return;
682-
}
683670
default:
684671
break;
685672
}
@@ -1009,6 +996,21 @@ class LuaObject final : public ObjectBase
1009996
static void drawCallback(void* target, int const layer, t_symbol* sym, int argc, t_atom* argv)
1010997
{
1011998
for (auto* object : allDrawTargets[static_cast<t_pdlua*>(target)]) {
999+
if(sym == gensym("lua_resized"))
1000+
{
1001+
if (argc >= 2) {
1002+
if (auto pdlua = object->ptr.get<t_pdlua>()) {
1003+
pdlua->gfx.width = atom_getfloat(argv);
1004+
pdlua->gfx.height = atom_getfloat(argv + 1);
1005+
}
1006+
1007+
MessageManager::callAsync([_object = SafePointer(object->object)] {
1008+
if (_object)
1009+
_object->updateBounds();
1010+
});
1011+
}
1012+
return;
1013+
}
10121014
object->guiCommandBuffer[layer].add({ sym, argc, argv });
10131015
if(sym == gensym("lua_end_paint"))
10141016
{

0 commit comments

Comments
 (0)