mirror of https://github.com/kivy/kivy.git
textinput: fix on_size done before text have been refreshed
This commit is contained in:
parent
07602d78c7
commit
78265dc6cc
|
@ -533,7 +533,6 @@ class TextInput(Widget):
|
|||
# size the text maybe be put after size_hint have been resolved.
|
||||
self._trigger_refresh_text()
|
||||
self.scroll_x = self.scroll_y = 0
|
||||
self.cursor = self.cursor
|
||||
|
||||
def _get_cursor_pos(self):
|
||||
# return the current cursor x/y from the row/col
|
||||
|
@ -742,6 +741,9 @@ class TextInput(Widget):
|
|||
return self._cursor
|
||||
|
||||
def _set_cursor(self, pos):
|
||||
if not self._lines:
|
||||
self._trigger_refresh_text()
|
||||
return
|
||||
l = self._lines
|
||||
cr = boundary(pos[1], 0, len(l) - 1)
|
||||
cc = boundary(pos[0], 0, len(l[cr]))
|
||||
|
|
Loading…
Reference in New Issue