mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 21:52:51 +00:00
-Take in consideration canvas layers for GUI input
This commit is contained in:
parent
c247f5ad61
commit
35a28f3442
@ -1193,6 +1193,14 @@ bool CanvasItem::is_local_transform_notification_enabled() const {
|
||||
return notify_local_transform;
|
||||
}
|
||||
|
||||
int CanvasItem::get_canvas_layer() const {
|
||||
|
||||
if (canvas_layer)
|
||||
return canvas_layer->get_layer();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
CanvasItem::CanvasItem() : xform_change(this) {
|
||||
|
||||
|
||||
|
@ -268,6 +268,7 @@ public:
|
||||
void set_notify_local_transform(bool p_enable);
|
||||
bool is_local_transform_notification_enabled() const;
|
||||
|
||||
int get_canvas_layer() const;
|
||||
|
||||
CanvasItem();
|
||||
~CanvasItem();
|
||||
|
@ -2071,6 +2071,8 @@ Control *Control::get_root_parent_control() const {
|
||||
return const_cast<Control*>(root);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Control::_bind_methods() {
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user