MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / calculateScaleFactor

Function calculateScaleFactor

src/tools/tool.cpp:353–364  ·  view source on GitHub ↗

* Returns the drawing scale value for the current pixel-per-inch setting. */

Source from the content-addressed store, hash-verified

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

Callers 1

settingsChangedMethod · 0.85

Calls 1

getSettingCachedMethod · 0.80

Tested by

no test coverage detected