| 37 | } |
| 38 | |
| 39 | bool GlyphPacker::CanBePacked(uint32_t glyphsCount, uint32_t width, uint32_t height) const |
| 40 | { |
| 41 | uint32_t x = m_cursor.x; |
| 42 | uint32_t y = m_cursor.y; |
| 43 | uint32_t step = m_yStep; |
| 44 | for (uint32_t i = 0; i < glyphsCount; i++) |
| 45 | { |
| 46 | if (x + width > m_size.x) |
| 47 | { |
| 48 | x = 0; |
| 49 | y += step; |
| 50 | } |
| 51 | |
| 52 | if (y + height > m_size.y) |
| 53 | return false; |
| 54 | |
| 55 | x += width; |
| 56 | step = std::max(height, step); |
| 57 | } |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | m2::RectF GlyphPacker::MapTextureCoords(m2::RectU const & pixelRect) const |
| 62 | { |