Skip to content

Commit

Permalink
Merge pull request #10 from cplus98/godot-4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
citizenll authored Oct 27, 2023
2 parents 0f8695c + 93c2bca commit 38b497a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ opts.Add(EnumVariable(
"armv7",
["armv7","arm64v8","x86","x86_64"]
))
opts.Add(EnumVariable(
"arch",
"Target MacOS architecture",
"arm64",
["arm64", "x86_64"]
))
opts.Add(EnumVariable(
"ios_arch",
"Target iOS architecture",
Expand Down Expand Up @@ -231,7 +237,7 @@ elif env["platform"] == "macos":
if env["target"] == "debug":
env.Append(CCFLAGS=["-Og", "-g"])
elif env["target"] == "release":
env.Append(CCFLAGS=["-Ofast"])
env.Append(CCFLAGS=["-Ofast", "-Os"])

target_path = "libgdflexbox.dylib"

Expand Down
12 changes: 12 additions & 0 deletions src/flexbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@ void Flexbox::remove_child(Flexbox *child)
YGNodeRemoveChild(m_node, child->m_node);
}

void Flexbox::remove_all_children(void)
{
YGNodeRemoveAllChildren(m_node);
}

void Flexbox::swap_child(Flexbox *child, unsigned index)
{
YGNodeSwapChild(m_node, child->m_node, index);
}

unsigned Flexbox::get_child_count(void) const
{
return YGNodeGetChildCount(m_node);
Expand Down Expand Up @@ -658,6 +668,8 @@ void Flexbox::_bind_methods()

ClassDB::bind_method(D_METHOD("insert_child"), &Flexbox::insert_child);
ClassDB::bind_method(D_METHOD("remove_child"), &Flexbox::remove_child);
ClassDB::bind_method(D_METHOD("remove_all_children"), &Flexbox::remove_all_children);
ClassDB::bind_method(D_METHOD("swap_child"), &Flexbox::swap_child);
ClassDB::bind_method(D_METHOD("get_child_count"), &Flexbox::get_child_count);
ClassDB::bind_method(D_METHOD("get_child"), &Flexbox::get_child);

Expand Down
2 changes: 2 additions & 0 deletions src/flexbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class Flexbox : public RefCounted
public: // Tree hierarchy mutators
void insert_child(Flexbox *child, unsigned index);
void remove_child(Flexbox *child);
void remove_all_children(void);
void swap_child(Flexbox *child, unsigned index);

public: // Tree hierarchy inspectors
unsigned get_child_count(void) const;
Expand Down

0 comments on commit 38b497a

Please sign in to comment.