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

Method MapTextureCoords

libs/drape/font_texture.cpp:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61m2::RectF GlyphPacker::MapTextureCoords(m2::RectU const & pixelRect) const
62{
63 auto const width = static_cast<float>(m_size.x);
64 auto const height = static_cast<float>(m_size.y);
65
66 // Half-pixel offset to eliminate artefacts on fetching from texture.
67 float offset = 0.0f;
68 if (pixelRect.SizeX() != 0 && pixelRect.SizeY() != 0)
69 offset = 0.5f;
70
71 return {(pixelRect.minX() + offset) / width, (pixelRect.minY() + offset) / height,
72 (pixelRect.maxX() - offset) / width, (pixelRect.maxY() - offset) / height};
73}
74
75bool GlyphPacker::IsFull() const
76{

Callers 2

MapResourceMethod · 0.45
UNIT_TESTFunction · 0.45

Calls 6

SizeXMethod · 0.80
SizeYMethod · 0.80
minXMethod · 0.80
minYMethod · 0.80
maxXMethod · 0.80
maxYMethod · 0.80

Tested by 1

UNIT_TESTFunction · 0.36