Merge pull request #4612 from bojidar-bg/fix-anchor-builds
Fix #4588 (crash in Control::_set_anchor)
This commit is contained in:
commit
7b471068cf
|
@ -1287,14 +1287,13 @@ void Control::set_anchor(Margin p_margin,AnchorType p_anchor, bool p_keep_margin
|
||||||
|
|
||||||
void Control::_set_anchor(Margin p_margin,AnchorType p_anchor) {
|
void Control::_set_anchor(Margin p_margin,AnchorType p_anchor) {
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
SceneTree *st=OS::get_singleton()->get_main_loop()->cast_to<SceneTree>();
|
if (is_inside_tree() && get_tree()->is_editor_hint()) {
|
||||||
if (st && st->is_editor_hint()) {
|
|
||||||
set_anchor(p_margin, p_anchor, EDITOR_DEF("2d_editor/keep_margins_when_changing_anchors", false));
|
set_anchor(p_margin, p_anchor, EDITOR_DEF("2d_editor/keep_margins_when_changing_anchors", false));
|
||||||
} else {
|
} else {
|
||||||
set_anchor(p_margin, p_anchor);
|
set_anchor(p_margin, p_anchor, false);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
set_anchor(p_margin, p_anchor);
|
set_anchor(p_margin, p_anchor, false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -463,6 +463,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
||||||
set("2d_editor/bone_color2",Color(0.75,0.75,0.75,0.9));
|
set("2d_editor/bone_color2",Color(0.75,0.75,0.75,0.9));
|
||||||
set("2d_editor/bone_selected_color",Color(0.9,0.45,0.45,0.9));
|
set("2d_editor/bone_selected_color",Color(0.9,0.45,0.45,0.9));
|
||||||
set("2d_editor/bone_ik_color",Color(0.9,0.9,0.45,0.9));
|
set("2d_editor/bone_ik_color",Color(0.9,0.9,0.45,0.9));
|
||||||
|
|
||||||
|
set("2d_editor/keep_margins_when_changing_anchors", false);
|
||||||
|
|
||||||
set("game_window_placement/rect",0);
|
set("game_window_placement/rect",0);
|
||||||
hints["game_window_placement/rect"]=PropertyInfo(Variant::INT,"game_window_placement/rect",PROPERTY_HINT_ENUM,"Default,Centered,Custom Position,Force Maximized,Force Full Screen");
|
hints["game_window_placement/rect"]=PropertyInfo(Variant::INT,"game_window_placement/rect",PROPERTY_HINT_ENUM,"Default,Centered,Custom Position,Force Maximized,Force Full Screen");
|
||||||
|
|
Loading…
Reference in New Issue