Преглед изворни кода

Scroll when caret goes out of view using Backspace

Jon Kristinsson пре 12 година
родитељ
комит
a8614c0c93
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      Modules/Contents/UI/Source/PolyUITextInput.cpp

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

@@ -1352,6 +1352,11 @@ void UITextInput::onKeyDown(PolyKEY key, wchar_t charCode) {
 			}
 		}
 		}
+        if (multiLine) {
+            if(linesContainer->getPosition().y + (lineOffset*(lineHeight+lineSpacing)+padding) < 0.0) {
+                scrollContainer->setScrollValue(0.0, ((((lineOffset) * ((lineHeight+lineSpacing)))) + padding)/(scrollContainer->getContentSize().y-scrollContainer->getHeight()));
+            }
+        }
 	}
 	
 	lines[lineOffset] = ctext;