fix multiline width calculation & feat: multiline tooltips support
This commit is contained in:
@@ -38,11 +38,11 @@ bool Font::isPrintableChar(uint codepoint) const {
|
||||
}
|
||||
}
|
||||
|
||||
int Font::calcWidth(const std::wstring& text, size_t length) const {
|
||||
int Font::calcWidth(std::wstring_view text, size_t length) const {
|
||||
return calcWidth(text, 0, length);
|
||||
}
|
||||
|
||||
int Font::calcWidth(const std::wstring& text, size_t offset, size_t length) const {
|
||||
int Font::calcWidth(std::wstring_view text, size_t offset, size_t length) const {
|
||||
return std::min(text.length()-offset, length) * glyphInterval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user