Skip to content

Commit

Permalink
Merge pull request godotengine#96343 from passivestar/dock-scale
Browse files Browse the repository at this point in the history
Fix dock width not respecting editor scale
  • Loading branch information
akien-mga committed Sep 8, 2024
2 parents 325c1cf + 8ff190b commit 5a92e27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions editor/editor_dock_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ void EditorDockManager::save_docks_to_config(Ref<ConfigFile> p_layout, const Str
}

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);
Expand Down Expand Up @@ -605,7 +605,7 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
continue;
}
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);
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7617,8 +7617,8 @@ EditorNode::EditorNode() {
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_2", 270 * EDSCALE);
default_layout->set_value(docks_section, "dock_hsplit_3", -270 * EDSCALE);
default_layout->set_value(docks_section, "dock_hsplit_2", 270);
default_layout->set_value(docks_section, "dock_hsplit_3", -270);
default_layout->set_value(docks_section, "dock_hsplit_4", 0);

_update_layouts_menu();
Expand Down

0 comments on commit 5a92e27

Please sign in to comment.