diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2016-12-13 08:41:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-13 08:41:22 +0100 |
commit | 44ec42bafc8427497830ae3cf8fb5d390c7ff665 (patch) | |
tree | e2d213118ccc4700fb855f47e46f0a9cc9bbbfe5 | |
parent | 043ece3e11825653d71b61590732aa8239f34aa3 (diff) | |
parent | 4118b21e43c59e6abfe4f45ccf236ee529626f4e (diff) |
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
-rw-r--r-- | servers/visual/visual_server_raster.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 1f22e31ab0..1bc78a60a3 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -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; } }; |