changed so that cursor position is a function of vidibleText

double cursorPos -> int cursorPos
cursorPos now represents index of selected char in text field