|
@@ -52,6 +52,7 @@ public:
|
|
|
Color ysort_modulate;
|
|
|
Transform2D ysort_xform;
|
|
|
Vector2 ysort_pos;
|
|
|
+ int ysort_index;
|
|
|
|
|
|
Vector<Item *> child_items;
|
|
|
|
|
@@ -68,6 +69,7 @@ public:
|
|
|
ysort_children_count = -1;
|
|
|
ysort_xform = Transform2D();
|
|
|
ysort_pos = Vector2();
|
|
|
+ ysort_index = 0;
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -83,8 +85,9 @@ public:
|
|
|
|
|
|
_FORCE_INLINE_ bool operator()(const Item *p_left, const Item *p_right) const {
|
|
|
|
|
|
- if (Math::is_equal_approx(p_left->ysort_pos.y, p_right->ysort_pos.y))
|
|
|
- return p_left->ysort_pos.x < p_right->ysort_pos.x;
|
|
|
+ if (Math::is_equal_approx(p_left->ysort_pos.y, p_right->ysort_pos.y)) {
|
|
|
+ return p_left->ysort_index < p_right->ysort_index;
|
|
|
+ }
|
|
|
|
|
|
return p_left->ysort_pos.y < p_right->ysort_pos.y;
|
|
|
}
|