Welcome to mirror list, hosted at ThFree Co, Russian Federation.

visual_scale.hpp « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: beb8f3e72ece94c14b8c40f0d826550886896e6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

namespace dp
{
inline double VisualScale(double exactDensityDPI)
{
  double constexpr kMdpiDensityDPI = 160.;
  double const tabletFactor = 1.2;
  // In case of tablets and iPads increased DPI is used to make visual scale bigger.
  if (GetPlatform().IsTablet())
    exactDensityDPI *= tabletFactor;

  // For some old devices (for example iPad 2) the density could be less than 160 DPI.
  // Returns one in that case to keep readable text on the map.
  return max(1.35, exactDensityDPI / kMdpiDensityDPI);
}
} //  namespace dp