diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-10 20:06:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-10 20:06:12 +0100 |
commit | e8f73124a7d97abc94cea3cf7fe5b5614f61a448 (patch) | |
tree | ff99e368359d56d760c8617af1021d0313635e38 /scene/gui/graph_node.h | |
parent | 3c39aa8302a4f07a1470685bbf66f883c49f571e (diff) | |
parent | 7961a1dea3e7ce8c4e7197a0000e35ab31e9ff2e (diff) |
Merge pull request #45845 from qarmin/cppcheck_scene_2
Initialize class variables with default values in scene/ [2/2]
Diffstat (limited to 'scene/gui/graph_node.h')
-rw-r--r-- | scene/gui/graph_node.h | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index cf66586e6b..1bc54dddb7 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -46,23 +46,14 @@ public: private: struct Slot { - bool enable_left; - int type_left; - Color color_left; - bool enable_right; - int type_right; - Color color_right; + bool enable_left = false; + int type_left = 0; + Color color_left = Color(1, 1, 1, 1); + bool enable_right = false; + int type_right = 0; + Color color_right = Color(1, 1, 1, 1); Ref<Texture2D> custom_slot_left; Ref<Texture2D> custom_slot_right; - - Slot() { - enable_left = false; - type_left = 0; - color_left = Color(1, 1, 1, 1); - enable_right = false; - type_right = 0; - color_right = Color(1, 1, 1, 1); - } }; String title; @@ -72,12 +63,12 @@ private: String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; - bool show_close; + bool show_close = false; Vector2 position_offset; - bool comment; - bool resizable; + bool comment = false; + bool resizable = false; - bool resizing; + bool resizing = false; Vector2 resizing_from; Vector2 resizing_from_size; @@ -87,7 +78,7 @@ private: struct ConnCache { Vector2 pos; - int type; + int type = 0; Color color; }; @@ -96,16 +87,16 @@ private: Map<int, Slot> slot_info; - bool connpos_dirty; + bool connpos_dirty = true; void _connpos_update(); void _resort(); void _shape(); Vector2 drag_from; - bool selected; + bool selected = false; - Overlay overlay; + Overlay overlay = OVERLAY_DISABLED; protected: void _gui_input(const Ref<InputEvent> &p_ev); |