Pick the largest suitable default scale. Fix #468 (#472)

This commit is contained in:
2024-11-19 18:17:15 -06:00
committed by GitHub
parent a725dc606a
commit 9d972a3961
19 changed files with 89 additions and 25 deletions

View File

@@ -29,7 +29,7 @@ extern fs::path file_in_mem;
extern short store_flags[3];
extern short current_active_pc;
rectangle whole_win_rect = {0,0,440,590};
rectangle whole_win_rect = {0,0,pc_height,pc_width};
extern rectangle pc_area_buttons[6][4] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
extern rectangle item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
extern rectangle pc_info_rect; // Frame that holds a pc's basic info and items

View File

@@ -169,10 +169,10 @@ sf::FloatRect compute_viewport(const sf::RenderWindow& mainPtr, float ui_scale)
void adjust_window (sf::RenderWindow& mainPtr, sf::View& mainView) {
double ui_scale = get_float_pref("UIScale", 1.0);
double ui_scale = get_ui_scale();
int const width = ui_scale * 590;
int const height = ui_scale * 440 + os_specific_y_offset();
int const width = ui_scale * pc_width;
int const height = ui_scale * pc_height + os_specific_y_offset();
mainPtr.create(sf::VideoMode(width, height), "Blades of Exile Character Editor", sf::Style::Titlebar | sf::Style::Close);
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
@@ -553,7 +553,7 @@ void pick_preferences() {
prefsDlog.attachClickHandlers(&prefs_event_filter, {"okay", "cancel"});
cLedGroup& uiScale = dynamic_cast<cLedGroup&>(prefsDlog["scaleui"]);
double ui_scale = get_float_pref("UIScale", 1.0);
double ui_scale = get_ui_scale();
if (ui_scale>0.95 && ui_scale<1.05) uiScale.setSelected("1");
else if (ui_scale>1.45 && ui_scale<1.55) uiScale.setSelected("1_5");
else if (ui_scale>1.95 && ui_scale<2.05) uiScale.setSelected("2");