summaryrefslogtreecommitdiffstats
path: root/scene/gui/graph_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/graph_node.cpp')
-rw-r--r--scene/gui/graph_node.cpp46
1 files changed, 2 insertions, 44 deletions
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index b0517caab0..2223beafda 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -286,37 +286,12 @@ void GraphNode::_resort() {
connpos_dirty = true;
}
-bool GraphNode::has_point(const Point2 &p_point) const {
- if (comment) {
- Ref<StyleBox> comment_sb = get_theme_stylebox(SNAME("comment"));
- Ref<Texture2D> resizer = get_theme_icon(SNAME("resizer"));
-
- if (Rect2(get_size() - resizer->get_size(), resizer->get_size()).has_point(p_point)) {
- return true;
- }
-
- if (Rect2(0, 0, get_size().width, comment_sb->get_margin(SIDE_TOP)).has_point(p_point)) {
- return true;
- }
-
- return false;
-
- } else {
- return Control::has_point(p_point);
- }
-}
-
void GraphNode::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
Ref<StyleBox> sb;
- if (comment) {
- sb = get_theme_stylebox(selected ? SNAME("comment_focus") : SNAME("comment"));
-
- } else {
- sb = get_theme_stylebox(selected ? SNAME("selected_frame") : SNAME("frame"));
- }
+ sb = get_theme_stylebox(selected ? SNAME("selected_frame") : SNAME("frame"));
Ref<StyleBox> sb_slot = get_theme_stylebox(SNAME("slot"));
@@ -440,7 +415,7 @@ void GraphNode::_shape() {
void GraphNode::_edit_set_position(const Point2 &p_position) {
GraphEdit *graph = Object::cast_to<GraphEdit>(get_parent());
if (graph) {
- Point2 offset = (p_position + graph->get_scroll_ofs()) * graph->get_zoom();
+ Point2 offset = (p_position + graph->get_scroll_offset()) * graph->get_zoom();
set_position_offset(offset);
}
set_position(p_position);
@@ -1003,19 +978,6 @@ GraphNode::Overlay GraphNode::get_overlay() const {
return overlay;
}
-void GraphNode::set_comment(bool p_enable) {
- if (comment == p_enable) {
- return;
- }
-
- comment = p_enable;
- queue_redraw();
-}
-
-bool GraphNode::is_comment() const {
- return comment;
-}
-
void GraphNode::set_resizable(bool p_enable) {
if (resizable == p_enable) {
return;
@@ -1115,9 +1077,6 @@ void GraphNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_position_offset", "offset"), &GraphNode::set_position_offset);
ClassDB::bind_method(D_METHOD("get_position_offset"), &GraphNode::get_position_offset);
- ClassDB::bind_method(D_METHOD("set_comment", "comment"), &GraphNode::set_comment);
- ClassDB::bind_method(D_METHOD("is_comment"), &GraphNode::is_comment);
-
ClassDB::bind_method(D_METHOD("set_resizable", "resizable"), &GraphNode::set_resizable);
ClassDB::bind_method(D_METHOD("is_resizable"), &GraphNode::is_resizable);
@@ -1157,7 +1116,6 @@ void GraphNode::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draggable"), "set_draggable", "is_draggable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selectable"), "set_selectable", "is_selectable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selected"), "set_selected", "is_selected");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "comment"), "set_comment", "is_comment");
ADD_PROPERTY(PropertyInfo(Variant::INT, "overlay", PROPERTY_HINT_ENUM, "Disabled,Breakpoint,Position"), "set_overlay", "get_overlay");
ADD_GROUP("BiDi", "");