Просмотр исходного кода

Fix issue #226

Added a null-check for scrollContainer to UITextInput::showLine
cib 12 лет назад
Родитель
Сommit
0a828de082
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Modules/Contents/UI/Source/PolyUITextInput.cpp

+ 5 - 0
Modules/Contents/UI/Source/PolyUITextInput.cpp

@@ -1055,6 +1055,11 @@ void UITextInput::Paste() {
 }
 
 void UITextInput::showLine(unsigned int lineNumber, bool top) {
+	// If there's no scroll container, no need to adjust the line.
+	if(!multiline) {
+		return;
+	}
+
 	if(top) {
 		scrollContainer->setScrollValue(0.0, ((((lineNumber) * ((lineHeight+lineSpacing)))) + padding)/(scrollContainer->getContentSize().y-scrollContainer->getHeight()));
 	} else {