2
0
Эх сурвалжийг харах

Caret scroll fix for Return key

Jon Kristinsson 12 жил өмнө
parent
commit
7e60bde8a8

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

@@ -1253,6 +1253,9 @@ void UITextInput::onKeyDown(PolyKEY key, wchar_t charCode) {
 			}			
 			}			
 			insertLine(true);
 			insertLine(true);
 			updateCaretPosition();
 			updateCaretPosition();
+            if(linesContainer->getPosition().y + (lineOffset*(lineHeight+lineSpacing)+padding) > scrollContainer->getHeight()-lineHeight-lineSpacing) {
+                scrollContainer->setScrollValue(0.0, (((((lineOffset) * ((lineHeight+lineSpacing)))) + padding-(scrollContainer->getHeight()-lineHeight-lineSpacing))/(scrollContainer->getContentSize().y-scrollContainer->getHeight())));
+            }
 		} else {
 		} else {
 			dispatchEvent(new Event(), Event::COMPLETE_EVENT);
 			dispatchEvent(new Event(), Event::COMPLETE_EVENT);
 		}
 		}