diff options
| author | Juan Linietsky | 2016-06-27 10:47:51 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-06-27 10:47:51 -0300 |
| commit | e2d208f1226f802b941d099c2f16223e7446cb07 (patch) | |
| tree | 304fe6f6cb880ee88a28028acc10268c89c6ab96 /scene/gui/control.cpp | |
| parent | 47d6cc08bbd745d63829e02ae408c4ce09ce1299 (diff) | |
| download | godot-e2d208f1226f802b941d099c2f16223e7446cb07.tar.gz godot-e2d208f1226f802b941d099c2f16223e7446cb07.tar.zst godot-e2d208f1226f802b941d099c2f16223e7446cb07.zip | |
Ability to rotate controls using tool, closes #3800
Diffstat (limited to 'scene/gui/control.cpp')
| -rw-r--r-- | scene/gui/control.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 2e28baa13..8f96fbbaf 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -49,14 +49,22 @@ Variant Control::edit_get_state() const { - return get_rect(); + Dictionary s; + s["rect"]=get_rect(); + s["rot"]=get_rotation(); + s["scale"]=get_scale(); + return s; } void Control::edit_set_state(const Variant& p_state) { - Rect2 state=p_state; + Dictionary s=p_state; + + Rect2 state=s["rect"]; set_pos(state.pos); set_size(state.size); + set_rotation(s["rot"]); + set_scale(s["scale"]); } void Control::set_custom_minimum_size(const Size2& p_custom) { |
