Resolution calculations performed by functions

Added functions for dpi <-> ppm transformations and used in all plugins.
This commit is contained in:
Mirco Miranda
2025-09-17 12:22:44 +02:00
parent 14286a6ab0
commit a4e18734bd
10 changed files with 120 additions and 68 deletions

View File

@@ -216,7 +216,7 @@ public:
auto v = QString::fromLatin1(pchar_t(res.data()), res.size()).toDouble(&ok);
if (ok && v > 0) {
if (m_pb._unitsOfMeasurement) { // Inches
return qRoundOrZero(width() / v / 25.4 * 1000);
return dpi2ppm(width() / v);
}
// Millimeters
return qRoundOrZero(width() / v * 1000);
@@ -230,7 +230,7 @@ public:
auto v = QString::fromLatin1(pchar_t(res.data()), res.size()).toDouble(&ok);
if (ok && v > 0) {
if (m_pb._unitsOfMeasurement) { // Inches
return qRoundOrZero(height() / v / 25.4 * 1000);
return dpi2ppm(height() / v);
}
// Millimeters
return qRoundOrZero(height() / v * 1000);