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

Method CanBePacked

libs/drape/font_texture.cpp:39–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool 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
61m2::RectF GlyphPacker::MapTextureCoords(m2::RectU const & pixelRect) const
62{

Callers 1

CanBeGlyphPackedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected