mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] Update charpos in InputText after moving the cursor up/down. (#3874)
This commit is contained in:
committed by
Frans de Jonge
parent
46a2571d3f
commit
2dc508537c
@@ -301,13 +301,13 @@ end
|
||||
|
||||
function InputText:upLine()
|
||||
if self.text_widget.moveCursorUp then
|
||||
self.text_widget:moveCursorUp()
|
||||
self.charpos = self.text_widget:moveCursorUp()
|
||||
end
|
||||
end
|
||||
|
||||
function InputText:downLine()
|
||||
if self.text_widget.moveCursorDown then
|
||||
self.text_widget:moveCursorDown()
|
||||
self.charpos = self.text_widget:moveCursorDown()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -96,6 +96,14 @@ function ScrollTextWidget:moveCursor(x, y)
|
||||
return self.text_widget:moveCursor(x, y)
|
||||
end
|
||||
|
||||
function ScrollTextWidget:moveCursorUp()
|
||||
return self.text_widget:moveCursorUp();
|
||||
end
|
||||
|
||||
function ScrollTextWidget:moveCursorDown()
|
||||
return self.text_widget:moveCursorDown();
|
||||
end
|
||||
|
||||
function ScrollTextWidget:scrollText(direction)
|
||||
if direction == 0 then return end
|
||||
local low, high
|
||||
|
||||
@@ -675,6 +675,7 @@ function TextBoxWidget:moveCursorUp()
|
||||
if charpos then
|
||||
self:moveCursorToCharpos(charpos)
|
||||
end
|
||||
return charpos
|
||||
end
|
||||
|
||||
function TextBoxWidget:moveCursorDown()
|
||||
@@ -685,6 +686,7 @@ function TextBoxWidget:moveCursorDown()
|
||||
if charpos then
|
||||
self:moveCursorToCharpos(charpos)
|
||||
end
|
||||
return charpos
|
||||
end
|
||||
|
||||
function TextBoxWidget:paintTo(bb, x, y)
|
||||
|
||||
Reference in New Issue
Block a user