Fixed VN Scrolling bug

This commit is contained in:
2023-07-12 21:08:07 -07:00
parent c2831f54e8
commit 4649469fee
2 changed files with 4 additions and 2 deletions

View File

@ -89,7 +89,7 @@ int32_t VNTextboxScroller::getTotalQuadsToBeRevealed() {
) {
quadsTotal += this->label->lines[i].quadCount;
}
return quadsTotal;
return quadsTotal;
}
bool_t VNTextboxScroller::hasRevealedAllCurrentCharacters() {

View File

@ -116,6 +116,7 @@ void UILabel::rebufferQuads(const std::vector<struct UILabelText> newTexts) {
std::vector<std::pair<glm::vec4, glm::vec4>> vertices;
struct FontShaderBufferData fontData;
quadCountTotal = 0;
quadCount = -1;
std::vector<struct UILabelText> realNewTexts;
float_t maxWidth = this->width;
@ -302,7 +303,8 @@ void UILabel::rebufferQuads(const std::vector<struct UILabelText> newTexts) {
// Now we insert a line. We do this because there is no newline at the end
// of the text, so we need to insert the last line manually.
fnInsertNewline(len);
bool_t isLast = itText == (newTexts.end() - 1);
if(isLast) fnInsertNewline(len);
// Next
++partIndex;