Skip to content

Commit

Permalink
Fix #245
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed May 6, 2023
1 parent 78ad6fb commit a80cf1a
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ private class ComponentCharsIterator(

// try to continue reading the new top component (for translatable components)
if (!readHeads.isEmpty) {
val readHead = readHeads.popInt()
val content = contentStrings.top()
readHead = readHeads.popInt()
content = contentStrings.top()
if (readHead < content.length) {
setComponent(components.top(), styles.top(), content, readHead)
this.component = components.top()
this.style = styles.top()
break
}
}
Expand Down Expand Up @@ -183,18 +184,14 @@ private class ComponentCharsIterator(
contentStrings.push(content)

// set current variables
setComponent(component, style, content, 0)
this.component = component
this.style = style
this.content = content
this.readHead = 0

// if the new component is empty, skip it
if (content.isEmpty())
nextComponent()
}

private fun setComponent(component: Component, style: Style, content: String, readHead: Int) {
this.component = component
this.style = style
this.content = content
this.readHead = readHead
}

}

0 comments on commit a80cf1a

Please sign in to comment.