summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-01-03 14:45:16 +0100
committerGitHub <noreply@github.com>2017-01-03 14:45:16 +0100
commitf2e99826c0b1e8227644bfab0795d858c504d279 (patch)
tree329fe11923b00b16dfbf2dd73c2ac504fdf15e19
parent8acd05835651f0484f47d0a13f524536189e4bf0 (diff)
parent8b8807e37d2530324116943896c72d381d65cc15 (diff)
Merge pull request #7422 from lonesurvivor/master
Improvement to y_sort: make clear which item has to be drawn first
-rw-r--r--servers/visual/visual_server_canvas.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index b5412ed608..e1edc47f9f 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -44,7 +44,10 @@ public:
_FORCE_INLINE_ bool operator()(const Item* p_left,const Item* 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;
}
};