diff options
| author | Hein-Pieter van Braam | 2017-09-01 22:33:39 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-09-02 01:59:26 +0200 |
| commit | 9c63ab99f0a505b0f60079bb30cc453b4415fddc (patch) | |
| tree | 7014cb6e8c2e71a0583656f76d3d37d719a74fb0 /editor/plugins/canvas_item_editor_plugin.cpp | |
| parent | dac150108ab3c1f41d5fd86cc6853f883064caaf (diff) | |
| download | godot-9c63ab99f0a505b0f60079bb30cc453b4415fddc.tar.gz godot-9c63ab99f0a505b0f60079bb30cc453b4415fddc.tar.zst godot-9c63ab99f0a505b0f60079bb30cc453b4415fddc.zip | |
Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 601842799..3b74601e7 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1881,7 +1881,7 @@ void CanvasItemEditor::_viewport_draw() { if (snap_show_grid) { //Draw the grid Size2 s = viewport->get_size(); - int last_cell; + int last_cell = 0; Transform2D xform = transform.affine_inverse(); Vector2 grid_offset; @@ -2257,17 +2257,17 @@ void CanvasItemEditor::_notification(int p_what) { anchors[MARGIN_RIGHT] = Object::cast_to<Control>(canvas_item)->get_anchor(MARGIN_RIGHT); anchors[MARGIN_TOP] = Object::cast_to<Control>(canvas_item)->get_anchor(MARGIN_TOP); anchors[MARGIN_BOTTOM] = Object::cast_to<Control>(canvas_item)->get_anchor(MARGIN_BOTTOM); - } - if (r != se->prev_rect || xform != se->prev_xform || pivot != se->prev_pivot || anchors[MARGIN_LEFT] != se->prev_anchors[MARGIN_LEFT] || anchors[MARGIN_RIGHT] != se->prev_anchors[MARGIN_RIGHT] || anchors[MARGIN_TOP] != se->prev_anchors[MARGIN_TOP] || anchors[MARGIN_BOTTOM] != se->prev_anchors[MARGIN_BOTTOM]) { - viewport->update(); - se->prev_rect = r; - se->prev_xform = xform; - se->prev_pivot = pivot; - se->prev_anchors[MARGIN_LEFT] = anchors[MARGIN_LEFT]; - se->prev_anchors[MARGIN_RIGHT] = anchors[MARGIN_RIGHT]; - se->prev_anchors[MARGIN_TOP] = anchors[MARGIN_TOP]; - se->prev_anchors[MARGIN_BOTTOM] = anchors[MARGIN_BOTTOM]; + if (r != se->prev_rect || xform != se->prev_xform || pivot != se->prev_pivot || anchors[MARGIN_LEFT] != se->prev_anchors[MARGIN_LEFT] || anchors[MARGIN_RIGHT] != se->prev_anchors[MARGIN_RIGHT] || anchors[MARGIN_TOP] != se->prev_anchors[MARGIN_TOP] || anchors[MARGIN_BOTTOM] != se->prev_anchors[MARGIN_BOTTOM]) { + viewport->update(); + se->prev_rect = r; + se->prev_xform = xform; + se->prev_pivot = pivot; + se->prev_anchors[MARGIN_LEFT] = anchors[MARGIN_LEFT]; + se->prev_anchors[MARGIN_RIGHT] = anchors[MARGIN_RIGHT]; + se->prev_anchors[MARGIN_TOP] = anchors[MARGIN_TOP]; + se->prev_anchors[MARGIN_BOTTOM] = anchors[MARGIN_BOTTOM]; + } } } |
