This commit is contained in:
Nerixyz 2024-10-23 21:52:02 +02:00
parent 5809eeb2bf
commit 2e30ebc825
No known key found for this signature in database
GPG key ID: 946BA188C5609CCC

View file

@ -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<QString::size_type>(i)]);
}
return x + this->getRect().left();
}