| 59 | } |
| 60 | |
| 61 | m2::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 | |
| 75 | bool GlyphPacker::IsFull() const |
| 76 | { |