diff options
| author | jonyrock | 2014-05-01 20:15:28 +0400 |
|---|---|---|
| committer | jonyrock | 2014-05-01 20:15:28 +0400 |
| commit | 209eaf6fa06eba8a05e5222bdab418cd0f20c91c (patch) | |
| tree | 94eac56be6ad254a7c09e13d5e14bd843626232c /tools/editor/plugins | |
| parent | 34aea718b11e105d30c938ad34e474b1bd8b5d63 (diff) | |
| parent | 6572d5128856b2ec55a2c417c92e584899f4906f (diff) | |
| download | godot-209eaf6fa06eba8a05e5222bdab418cd0f20c91c.tar.gz godot-209eaf6fa06eba8a05e5222bdab418cd0f20c91c.tar.zst godot-209eaf6fa06eba8a05e5222bdab418cd0f20c91c.zip | |
Merge remote-tracking branch 'upstream/master' into pair_symbols_tool
Diffstat (limited to 'tools/editor/plugins')
| -rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 1a365d7f3..7914ecfd9 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -85,8 +85,10 @@ Dictionary CanvasItemEditor::get_state() const { Dictionary state; state["zoom"]=zoom; state["ofs"]=Point2(h_scroll->get_val(),v_scroll->get_val()); - state["pixel_snap"]=pixel_snap; // state["ofs"]=-transform.get_origin(); + state["use_snap"]=is_snap_active(); + state["snap"]=snap; + state["pixel_snap"]=pixel_snap; return state; } void CanvasItemEditor::set_state(const Dictionary& p_state){ @@ -103,12 +105,19 @@ void CanvasItemEditor::set_state(const Dictionary& p_state){ v_scroll->set_val(ofs.y); } + if (state.has("use_snap")) { + int idx = edit_menu->get_popup()->get_item_index(SNAP_USE); + edit_menu->get_popup()->set_item_checked(idx,state["use_snap"]); + } + + if (state.has("snap")) { + snap=state["snap"]; + } + if (state.has("pixel_snap")) { pixel_snap=state["pixel_snap"]; int idx = edit_menu->get_popup()->get_item_index(SNAP_USE_PIXEL); edit_menu->get_popup()->set_item_checked(idx,pixel_snap); - - } } |
