mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
fix label font cache
This commit is contained in:
parent
c8ba5b5dbb
commit
edc6810283
7 changed files with 75 additions and 36 deletions
|
|
@ -38,6 +38,10 @@ bool Font::isPrintableChar(uint codepoint) const {
|
|||
}
|
||||
}
|
||||
|
||||
int FontMetrics::calcWidth(std::wstring_view text, size_t offset, size_t length) const {
|
||||
return std::min(text.length() - offset, length) * glyphInterval;
|
||||
}
|
||||
|
||||
int Font::calcWidth(std::wstring_view text, size_t length) const {
|
||||
return calcWidth(text, 0, length);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue