summaryrefslogtreecommitdiff
path: root/scene/gui/control.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-24 10:57:42 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-24 10:57:42 -0300
commit35a28f34426eb6c44a5e321bbd630c64d8b38de0 (patch)
treeb1bffbbe03280874103f4bcd3d89f5ebad6c0800 /scene/gui/control.h
parentc247f5ad61f2575c321fb8117ed4212611e8cdf4 (diff)
-Take in consideration canvas layers for GUI input
Diffstat (limited to 'scene/gui/control.h')
-rw-r--r--scene/gui/control.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/control.h b/scene/gui/control.h
index a16d88a6df..74d40b7579 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -97,7 +97,12 @@ private:
struct CComparator {
- bool operator()(const Control* p_a, const Control* p_b) const { return p_b->is_greater_than(p_a); }
+ bool operator()(const Control* p_a, const Control* p_b) const {
+ if (p_a->get_canvas_layer()==p_b->get_canvas_layer())
+ return p_b->is_greater_than(p_a);
+ else
+ return p_a->get_canvas_layer() < p_b->get_canvas_layer();
+ }
};
struct Data {