Node* _floor(Node* node, const Key& key) const
	{
		if (! node || node == _end) return nullptr;
		
		else if (key > node->key)
		{
			Node* result = _floor(node->right, key);
			
			return result ? result : node;
		}
		
		else return _floor(node->left, key);
	}
Exemple #2
0
inline float GdiFont::GetWidthFromCharacter( wchar_t c )
{
	unsigned int idx = GetGlyphByCharacter(c);
	if (idx > 0 && idx < font_count)
		return m_FontGlyphs[idx].w;

	if (c >= 0x2000)
	{
		return	m_nFontSize;
	}
	else
	{
		return	_floor(m_nFontSize / 2);
	}
}
	Iterator floor(const Key& key) const
	{
		return _floor(_root, key);
	}