src/ui.c

changeset 231
0da563c4e39c
parent 155
b598b4eb4b44
equal deleted inserted replaced
230:02090b2d147e 231:0da563c4e39c
41 41
42 float asc_ui_get_scale(void) { 42 float asc_ui_get_scale(void) {
43 return asc_active_window->ui_scale; 43 return asc_active_window->ui_scale;
44 } 44 }
45 45
46 void asc_ui_scale_auto(void) { 46 float asc_ui_scale_auto(void) {
47 asc_vec2u res = asc_window_display_resolution(); 47 const asc_vec2u res = asc_window_display_resolution();
48 float scale;
48 if (res.width > 3100) { 49 if (res.width > 3100) {
49 asc_ui_scale(2.0f); 50 scale = 2.0f;
50 } else if (res.width > 2000) { 51 } else if (res.width > 2000) {
51 asc_ui_scale(1.5f); 52 scale = 1.5f;
52 } else { 53 } else {
53 return asc_ui_scale(1.f); 54 scale = 1.f;
54 } 55 }
56 asc_ui_scale(scale);
57 return scale;
55 } 58 }

mercurial