mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 06:03:09 +00:00
Fix dock width not respecting editor scale
This commit is contained in:
parent
a5830f6eb9
commit
8ff190b065
@ -509,7 +509,7 @@ void EditorDockManager::save_docks_to_config(Ref<ConfigFile> p_layout, const Str
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < hsplits.size(); i++) {
|
for (int i = 0; i < hsplits.size(); i++) {
|
||||||
p_layout->set_value(p_section, "dock_hsplit_" + itos(i + 1), hsplits[i]->get_split_offset());
|
p_layout->set_value(p_section, "dock_hsplit_" + itos(i + 1), int(hsplits[i]->get_split_offset() / EDSCALE));
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemDock::get_singleton()->save_layout_to_config(p_layout, p_section);
|
FileSystemDock::get_singleton()->save_layout_to_config(p_layout, p_section);
|
||||||
@ -605,7 +605,7 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int ofs = p_layout->get_value(p_section, "dock_hsplit_" + itos(i + 1));
|
int ofs = p_layout->get_value(p_section, "dock_hsplit_" + itos(i + 1));
|
||||||
hsplits[i]->set_split_offset(ofs);
|
hsplits[i]->set_split_offset(ofs * EDSCALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemDock::get_singleton()->load_layout_from_config(p_layout, p_section);
|
FileSystemDock::get_singleton()->load_layout_from_config(p_layout, p_section);
|
||||||
|
@ -7555,8 +7555,8 @@ EditorNode::EditorNode() {
|
|||||||
default_layout->set_value(docks_section, "dock_split_" + itos(i + 1), 0);
|
default_layout->set_value(docks_section, "dock_split_" + itos(i + 1), 0);
|
||||||
}
|
}
|
||||||
default_layout->set_value(docks_section, "dock_hsplit_1", 0);
|
default_layout->set_value(docks_section, "dock_hsplit_1", 0);
|
||||||
default_layout->set_value(docks_section, "dock_hsplit_2", 270 * EDSCALE);
|
default_layout->set_value(docks_section, "dock_hsplit_2", 270);
|
||||||
default_layout->set_value(docks_section, "dock_hsplit_3", -270 * EDSCALE);
|
default_layout->set_value(docks_section, "dock_hsplit_3", -270);
|
||||||
default_layout->set_value(docks_section, "dock_hsplit_4", 0);
|
default_layout->set_value(docks_section, "dock_hsplit_4", 0);
|
||||||
|
|
||||||
_update_layouts_menu();
|
_update_layouts_menu();
|
||||||
|
Loading…
Reference in New Issue
Block a user