diff options
Diffstat (limited to 'servers/visual/visual_server_canvas.h')
-rw-r--r-- | servers/visual/visual_server_canvas.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h index d12bd520bf..4b7422b15a 100644 --- a/servers/visual/visual_server_canvas.h +++ b/servers/visual/visual_server_canvas.h @@ -48,6 +48,9 @@ public: bool use_parent_material; int index; bool children_order_dirty; + int ysort_children_count; + Transform2D ysort_xform; + Vector2 ysort_pos; Vector<Item *> child_items; @@ -61,6 +64,9 @@ public: use_parent_material = false; z_relative = true; index = 0; + ysort_children_count = -1; + ysort_xform = Transform2D(); + ysort_pos = Vector2(); } }; @@ -76,10 +82,10 @@ public: _FORCE_INLINE_ bool operator()(const Item *p_left, const Item *p_right) const { - if (Math::abs(p_left->xform.elements[2].y - p_right->xform.elements[2].y) < CMP_EPSILON) - return p_left->xform.elements[2].x < p_right->xform.elements[2].x; + if (Math::abs(p_left->ysort_pos.y - p_right->ysort_pos.y) < CMP_EPSILON) + return p_left->ysort_pos.x < p_right->ysort_pos.x; else - return p_left->xform.elements[2].y < p_right->xform.elements[2].y; + return p_left->ysort_pos.y < p_right->ysort_pos.y; } }; |