Merge pull request #7241 from lonesurvivor/master

y_sort: make clear which item has to be drawn first when two have the same y-coordinate
This commit is contained in:
Rémi Verschelde 2016-12-13 08:41:22 +01:00 committed by GitHub
commit 44ec42bafc

View file

@ -407,7 +407,10 @@ class VisualServerRaster : public VisualServer {
_FORCE_INLINE_ bool operator()(const CanvasItem* p_left,const CanvasItem* p_right) const {
return p_left->xform.elements[2].y < p_right->xform.elements[2].y;
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;
else
return p_left->xform.elements[2].y < p_right->xform.elements[2].y;
}
};