summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreska <eska@eska.me>2016-11-11 03:48:13 +0100
committereska <eska@eska.me>2016-11-13 15:27:17 +0100
commit31f929caa2bc8422c0a6bb50f81500e1f4db101b (patch)
tree262d9567f3d529da802dbb0ee3294622b9ff7962
parent7d1230a266f4eab3262ebfcbf4a89148dfcb3c48 (diff)
Clarify a NULL comparison
'TreeItem::get_children()' does not return the child count, but rather a pointer to the children. This comparison caused an error during WebAssembly builds using the LLVM backend path.
-rw-r--r--scene/gui/tree.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 912371142f..d974e09275 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1331,7 +1331,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
int root_ofs = children_pos.x + (hide_folding?cache.hseparation:cache.item_margin);
int parent_ofs = p_pos.x + (hide_folding?cache.hseparation:cache.item_margin);
Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h/2)-cache.offset+p_draw_ofs;
- if (c->get_children() > 0)
+ if (c->get_children() != NULL)
root_pos -= Point2i(cache.arrow->get_width(),0);
Point2i parent_pos = Point2i(parent_ofs - cache.arrow->get_width()/2, p_pos.y + label_h/2 + cache.arrow->get_height()/2)-cache.offset+p_draw_ofs;