I have managed to fix this issue by doing the below changes:
in uitooltip.py
Search for:
def ClearToolTip(self):
self.toolTipHeight = 12
self.childrenList = []
Add under self.childrenList = []:
self.centeredTextLines = []
Change AppendTextLine function to this:
def AppendTextLine(self, text, color=FONT_COLOR, centerAlign=True, show=True):
textLine = ui.TextLine()
textLine.SetParent(self)
textLine.SetFontName(self.defFontName)
textLine.SetPackedFontColor(color)
textLine.SetText(text)
textLine.SetOutline()
textLine.SetFeather(False)
if show:
textLine.Show()
textWidth, _ = textLine.GetTextSize()
textWidth += 20 # padding
tooltipWidthChanged = False
if self.toolTipWidth < textWidth:
self.toolTipWidth = textWidth
tooltipWidthChanged = True
self.childrenList.append(textLine)
if centerAlign:
textLine.SetHorizontalAlignCenter()
textLine.SetPosition(self.toolTipWidth / 2, self.toolTipHeight)
if not hasattr(self, "centeredTextLines"):
self.centeredTextLines = []
self.centeredTextLines.append(textLine)
else:
textLine.SetHorizontalAlignLeft()
textLine.SetPosition(10, self.toolTipHeight)
self.toolTipHeight += self.TEXT_LINE_HEIGHT
self.ResizeToolTip()
if tooltipWidthChanged and hasattr(self, "centeredTextLines"):
for line in self.centeredTextLines:
line.SetPosition(self.toolTipWidth / 2, line.GetLocalPosition()[1])
line.SetHorizontalAlignCenter()
return textLine