|
@@ -4009,6 +4009,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
|
|
show_rulers = !show_rulers;
|
|
show_rulers = !show_rulers;
|
|
int idx = view_menu->get_popup()->get_item_index(SHOW_RULERS);
|
|
int idx = view_menu->get_popup()->get_item_index(SHOW_RULERS);
|
|
view_menu->get_popup()->set_item_checked(idx, show_rulers);
|
|
view_menu->get_popup()->set_item_checked(idx, show_rulers);
|
|
|
|
+ _update_scrollbars();
|
|
viewport->update();
|
|
viewport->update();
|
|
} break;
|
|
} break;
|
|
case SHOW_GUIDES: {
|
|
case SHOW_GUIDES: {
|
|
@@ -4531,6 +4532,7 @@ Dictionary CanvasItemEditor::get_state() const {
|
|
state["show_rulers"] = show_rulers;
|
|
state["show_rulers"] = show_rulers;
|
|
state["show_guides"] = show_guides;
|
|
state["show_guides"] = show_guides;
|
|
state["show_helpers"] = show_helpers;
|
|
state["show_helpers"] = show_helpers;
|
|
|
|
+ state["show_zoom_control"] = zoom_hb->is_visible();
|
|
state["show_edit_locks"] = show_edit_locks;
|
|
state["show_edit_locks"] = show_edit_locks;
|
|
state["snap_rotation"] = snap_rotation;
|
|
state["snap_rotation"] = snap_rotation;
|
|
state["snap_relative"] = snap_relative;
|
|
state["snap_relative"] = snap_relative;
|
|
@@ -4541,6 +4543,7 @@ Dictionary CanvasItemEditor::get_state() const {
|
|
|
|
|
|
void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
|
void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
|
|
|
|
|
|
|
+ bool update_scrollbars = false;
|
|
Dictionary state = p_state;
|
|
Dictionary state = p_state;
|
|
if (state.has("zoom")) {
|
|
if (state.has("zoom")) {
|
|
zoom = p_state["zoom"];
|
|
zoom = p_state["zoom"];
|
|
@@ -4549,7 +4552,7 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
|
if (state.has("ofs")) {
|
|
if (state.has("ofs")) {
|
|
view_offset = p_state["ofs"];
|
|
view_offset = p_state["ofs"];
|
|
previous_update_view_offset = view_offset;
|
|
previous_update_view_offset = view_offset;
|
|
- _update_scrollbars();
|
|
|
|
|
|
+ update_scrollbars = true;
|
|
}
|
|
}
|
|
|
|
|
|
if (state.has("grid_offset")) {
|
|
if (state.has("grid_offset")) {
|
|
@@ -4637,6 +4640,7 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
|
show_rulers = state["show_rulers"];
|
|
show_rulers = state["show_rulers"];
|
|
int idx = view_menu->get_popup()->get_item_index(SHOW_RULERS);
|
|
int idx = view_menu->get_popup()->get_item_index(SHOW_RULERS);
|
|
view_menu->get_popup()->set_item_checked(idx, show_rulers);
|
|
view_menu->get_popup()->set_item_checked(idx, show_rulers);
|
|
|
|
+ update_scrollbars = true;
|
|
}
|
|
}
|
|
|
|
|
|
if (state.has("show_guides")) {
|
|
if (state.has("show_guides")) {
|
|
@@ -4657,6 +4661,11 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
|
view_menu->get_popup()->set_item_checked(idx, show_edit_locks);
|
|
view_menu->get_popup()->set_item_checked(idx, show_edit_locks);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (state.has("show_zoom_control")) {
|
|
|
|
+ // This one is not user-controllable, but instrumentable
|
|
|
|
+ zoom_hb->set_visible(state["show_zoom_control"]);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (state.has("snap_rotation")) {
|
|
if (state.has("snap_rotation")) {
|
|
snap_rotation = state["snap_rotation"];
|
|
snap_rotation = state["snap_rotation"];
|
|
int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_ROTATION);
|
|
int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_ROTATION);
|
|
@@ -4681,6 +4690,9 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
|
skeleton_menu->get_popup()->set_item_checked(idx, skeleton_show_bones);
|
|
skeleton_menu->get_popup()->set_item_checked(idx, skeleton_show_bones);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (update_scrollbars) {
|
|
|
|
+ _update_scrollbars();
|
|
|
|
+ }
|
|
viewport->update();
|
|
viewport->update();
|
|
}
|
|
}
|
|
|
|
|