diff --git a/src/messages/layouts/MessageLayoutElement.cpp b/src/messages/layouts/MessageLayoutElement.cpp index 50b8126df..0031348d6 100644 --- a/src/messages/layouts/MessageLayoutElement.cpp +++ b/src/messages/layouts/MessageLayoutElement.cpp @@ -516,7 +516,8 @@ int TextLayoutElement::getXFromIndex(size_t index) int x = 0; for (size_t i = 0; i < index; i++) { - x += metrics.horizontalAdvance(this->getText()[i]); + x += metrics.horizontalAdvance( + this->getText()[static_cast(i)]); } return x + this->getRect().left(); }