mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Adjust wraping with offset
This commit is contained in:
parent
ca529e4bb8
commit
b0cbf5c51a
1 changed files with 2 additions and 2 deletions
|
@ -387,7 +387,7 @@ void Font3D::drawString(gpu::Batch& batch, float x, float y, const QString& str,
|
|||
bool forceNewLine = false;
|
||||
|
||||
// Handle wrapping
|
||||
if (!isNewLine && (bounds.x != -1) && (advance.x + computeExtent(token).x > bounds.x)) {
|
||||
if (!isNewLine && (bounds.x != -1) && (advance.x + computeExtent(token).x > x + bounds.x)) {
|
||||
// We are out of the x bound, force new line
|
||||
forceNewLine = true;
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ void Font3D::drawString(gpu::Batch& batch, float x, float y, const QString& str,
|
|||
break;
|
||||
}
|
||||
}
|
||||
if ((bounds.y != -1) && (advance.y - _fontSize < -bounds.y)) {
|
||||
if ((bounds.y != -1) && (advance.y - _fontSize < -y - bounds.y)) {
|
||||
// We are out of the y bound, stop drawing
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue