* Returns the drawing scale value for the current pixel-per-inch setting. */
| 351 | * Returns the drawing scale value for the current pixel-per-inch setting. |
| 352 | */ |
| 353 | unsigned int calculateScaleFactor() |
| 354 | { |
| 355 | // NOTE: The returned value must be supported by PointHandles::loadHandleImage() ! |
| 356 | const auto base_dpi = qreal(96); |
| 357 | const auto ppi = Settings::getInstance().getSettingCached(Settings::General_PixelsPerInch).toReal(); |
| 358 | if (ppi <= base_dpi) |
| 359 | return 1; |
| 360 | else if (ppi <= base_dpi*2) |
| 361 | return 2; |
| 362 | else |
| 363 | return 4; |
| 364 | } |
| 365 | |
| 366 | } // namespace |
| 367 |
no test coverage detected