Commit 072f7d26 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

kcm: When simplifying ratios, take into account that they could be rotated

The resolution could be 800x1280 instead of 1280x800 and we still want
to call them 10:16 rather than 5:8.

BUG: 459063
parent 050c1a7e
Pipeline #231818 passed with stage
in 1 minute and 16 seconds
......@@ -577,13 +577,13 @@ QVariantList OutputModel::resolutionsStrings(const KScreen::OutputPtr &output) c
} else {
int divisor = greatestCommonDivisor(size.width(), size.height());
if (size.height() / divisor == 5) { // Prefer "16:10" over "8:5"
if (size.height() / divisor == 5 || size.height() / divisor == 8) { // Prefer "16:10" over "8:5"
divisor /= 2;
} else if (size.height() / divisor == 27) { // Prefer "21:9" over "64:27"
} else if (size.height() / divisor == 27 || size.height() / divisor == 64) { // Prefer "21:9" over "64:27"
divisor *= 3;
} else if (size.height() / divisor == 18) { // Prefer "21:9" over "43:18"
} else if (size.height() / divisor == 18 || size.height() / divisor == 43) { // Prefer "21:9" over "43:18"
divisor *= 2;
} else if (size.height() / divisor == 384) { // Prefer "16:9" over "683:384"
} else if (size.height() / divisor == 384 || size.height() / divisor == 683) { // Prefer "16:9" over "683:384"
divisor *= 41;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment