summaryrefslogtreecommitdiffstats
path: root/scene/gui/graph_edit.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-01-14 23:00:20 +0100
committerGitHub <noreply@github.com>2020-01-14 23:00:20 +0100
commit7971ec74f9e0d4bf5beeea7b63587b73bb0cb563 (patch)
tree569595bd25549505faf1bc9390dbdc43e3c82c1f /scene/gui/graph_edit.cpp
parent42d3d06195a72d47fc19a4134fd0807ce17badca (diff)
parent34bf81fa7c201bd5bd28636013a17a922d89173a (diff)
downloadredot-engine-7971ec74f9e0d4bf5beeea7b63587b73bb0cb563.tar.gz
Merge pull request #35133 from YeldhamDev/scrollbar_cleanup
Cleanup unnecessary code from before the scrollbar overlapping fixes
Diffstat (limited to 'scene/gui/graph_edit.cpp')
-rw-r--r--scene/gui/graph_edit.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 42bb8023f2..399f998cb9 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -289,20 +289,6 @@ void GraphEdit::_notification(int p_what) {
zoom_plus->set_icon(get_icon("more"));
snap_button->set_icon(get_icon("snap"));
}
- if (p_what == NOTIFICATION_READY) {
- Size2 hmin = h_scroll->get_combined_minimum_size();
- Size2 vmin = v_scroll->get_combined_minimum_size();
-
- v_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -vmin.width);
- v_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
- v_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0);
- v_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
-
- h_scroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0);
- h_scroll->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
- h_scroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -hmin.height);
- h_scroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
- }
if (p_what == NOTIFICATION_DRAW) {
draw_style_box(get_stylebox("bg"), Rect2(Point2(), get_size()));
@@ -1355,10 +1341,13 @@ GraphEdit::GraphEdit() {
h_scroll = memnew(HScrollBar);
h_scroll->set_name("_h_scroll");
top_layer->add_child(h_scroll);
+ h_scroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE);
v_scroll = memnew(VScrollBar);
v_scroll->set_name("_v_scroll");
top_layer->add_child(v_scroll);
+ v_scroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE);
+
updating = false;
connecting = false;
right_disconnects = false;