File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ EMSCRIPTEN_DECLARE_VAL_TYPE(DoubleList);
3535// Helper function to convert a Point to a JavaScript object
3636emscripten::val pointToJSObject (const Point& point) {
3737 emscripten::val obj = emscripten::val::object ();
38- obj.set (" x" , getX (point));
39- obj.set (" y" , getY (point));
38+ obj.set (" x" , long { static_cast < long >( getX (point)) } );
39+ obj.set (" y" , long { static_cast < long >( getY (point)) } );
4040 return obj;
4141}
4242
@@ -167,6 +167,8 @@ EMSCRIPTEN_BINDINGS(libnest2d_js) {
167167 .function (" boundingBox" , &Item::boundingBox)
168168 .function (" translate" , &Item::translate)
169169 .function (" rotate" , &Item::rotate)
170+ .function (" rotation" , optional_override ([](const Item& self) { return self.rotation (); }))
171+ .function (" translation" , optional_override ([](const Item& self) { return self.translation (); }))
170172 .function (" isFixed" , &Item::isFixed)
171173 .function (" isDisallowedArea" , &Item::isDisallowedArea)
172174 .function (" markAsFixedInBin" , &Item::markAsFixedInBin)
You can’t perform that action at this time.
0 commit comments