small improvement to y_sort: make clear which item has to be drawn first when two have the same y-coordinate

This commit is contained in:
Patrick Reh 2016-09-16 18:00:51 +02:00 committed by lonesurvivor
parent 4235abe8dc
commit 4118b21e43

View file

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