diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 13 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tree.h | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index be211504a6..b7bc2f9c9e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -705,12 +705,12 @@ void Control::set_drag_forwarding(Control *p_target) { if (p_target) data.drag_owner = p_target->get_instance_id(); else - data.drag_owner = 0; + data.drag_owner = ObjectID(); } Variant Control::get_drag_data(const Point2 &p_point) { - if (data.drag_owner) { + if (data.drag_owner.is_valid()) { Object *obj = ObjectDB::get_instance(data.drag_owner); if (obj) { Control *c = Object::cast_to<Control>(obj); @@ -732,7 +732,7 @@ Variant Control::get_drag_data(const Point2 &p_point) { bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const { - if (data.drag_owner) { + if (data.drag_owner.is_valid()) { Object *obj = ObjectDB::get_instance(data.drag_owner); if (obj) { Control *c = Object::cast_to<Control>(obj); @@ -753,7 +753,7 @@ bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const } void Control::drop_data(const Point2 &p_point, const Variant &p_data) { - if (data.drag_owner) { + if (data.drag_owner.is_valid()) { Object *obj = ObjectDB::get_instance(data.drag_owner); if (obj) { Control *c = Object::cast_to<Control>(obj); @@ -2224,7 +2224,7 @@ void Control::_modal_stack_remove() { get_viewport()->_gui_remove_from_modal_stack(element, data.modal_prev_focus_owner); - data.modal_prev_focus_owner = 0; + data.modal_prev_focus_owner = ObjectID(); } void Control::_propagate_theme_changed(CanvasItem *p_at, Control *p_owner, bool p_assign) { @@ -3110,7 +3110,7 @@ Control::Control() { data.rotation = 0; data.parent_canvas_item = NULL; data.scale = Vector2(1, 1); - data.drag_owner = 0; + data.modal_frame = 0; data.block_minimum_size_adjust = false; data.disable_visibility_clip = false; @@ -3125,7 +3125,6 @@ Control::Control() { data.margin[i] = 0; } data.focus_mode = FOCUS_NONE; - data.modal_prev_focus_owner = 0; } Control::~Control() { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 7bfe060065..08835be9fd 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1399,7 +1399,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 } break; case TreeItem::CELL_MODE_CUSTOM: { - if (p_item->cells[i].custom_draw_obj) { + if (p_item->cells[i].custom_draw_obj.is_valid()) { Object *cdo = ObjectDB::get_instance(p_item->cells[i].custom_draw_obj); if (cdo) diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 2072d0fd13..b58f937c57 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -112,7 +112,7 @@ private: Cell() { - custom_draw_obj = 0; + custom_draw_obj = ObjectID(); custom_button = false; mode = TreeItem::CELL_MODE_STRING; min = 0; |