Simplify sc_size assignment

Assign the whole struct instead of each field separately.
This commit is contained in:
Romain Vimont 2021-12-20 19:21:19 +01:00
parent 720c3064df
commit 2f091beeaa

View file

@ -101,8 +101,7 @@ get_optimal_size(struct sc_size current_size, struct sc_size content_size) {
struct sc_size display_size; struct sc_size display_size;
if (!get_preferred_display_bounds(&display_size)) { if (!get_preferred_display_bounds(&display_size)) {
// could not get display bounds, do not constraint the size // could not get display bounds, do not constraint the size
window_size.width = current_size.width; window_size = current_size;
window_size.height = current_size.height;
} else { } else {
window_size.width = MIN(current_size.width, display_size.width); window_size.width = MIN(current_size.width, display_size.width);
window_size.height = MIN(current_size.height, display_size.height); window_size.height = MIN(current_size.height, display_size.height);