MCPcopy Create free account
hub / github.com/comaps/comaps / GetRectForDrawScale

Function GetRectForDrawScale

libs/drape_frontend/visual_params.cpp:205–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205m2::RectD GetRectForDrawScale(int drawScale, m2::PointD const & center, uint32_t tileSize, double visualScale)
206{
207 // +1 - we will calculate half length for each side
208 double const factor = 1 << (std::max(1, drawScale - GetTileScaleIncrement(tileSize, visualScale)) + 1);
209
210 double const len = mercator::Bounds::kRangeX / factor;
211
212 return m2::RectD(mercator::ClampX(center.x - len), mercator::ClampY(center.y - len), mercator::ClampX(center.x + len),
213 mercator::ClampY(center.y + len));
214}
215
216m2::RectD GetRectForDrawScale(int drawScale, m2::PointD const & center)
217{

Calls 6

GetTileScaleIncrementFunction · 0.85
ClampXFunction · 0.85
ClampYFunction · 0.85
GetTileSizeMethod · 0.80
GetVisualScaleMethod · 0.80
iroundFunction · 0.50

Tested by

no test coverage detected