Remove Utility module and move its content to Core and TextRenderer modules
This commit is contained in:
committed by
Jérôme Leclercq
parent
965a00182c
commit
e64c2b036e
22
include/Nazara/TextRenderer/AbstractTextDrawer.inl
Normal file
22
include/Nazara/TextRenderer/AbstractTextDrawer.inl
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Text renderer"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/TextRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline std::size_t AbstractTextDrawer::GetLineGlyphCount(std::size_t index) const
|
||||
{
|
||||
std::size_t lineCount = GetLineCount();
|
||||
const auto& lineInfo = GetLine(index);
|
||||
if (index == lineCount - 1)
|
||||
return GetGlyphCount() - lineInfo.glyphIndex;
|
||||
|
||||
const auto& nextLineInfo = GetLine(index + 1);
|
||||
|
||||
return nextLineInfo.glyphIndex - lineInfo.glyphIndex;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/TextRenderer/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user