mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
mod: fix bug in cursor move
only move cursor to word in current view
This commit is contained in:
11
graphics.lua
11
graphics.lua
@@ -42,6 +42,7 @@ Cursor = {
|
||||
h = 10,
|
||||
w = nil,
|
||||
line_w = nil,
|
||||
is_cleared = true,
|
||||
}
|
||||
|
||||
function Cursor:new(o)
|
||||
@@ -76,11 +77,17 @@ function Cursor:_draw(x, y)
|
||||
end
|
||||
|
||||
function Cursor:draw()
|
||||
self:_draw(self.x_pos, self.y_pos)
|
||||
if self.is_cleared then
|
||||
self.is_cleared = false
|
||||
self:_draw(self.x_pos, self.y_pos)
|
||||
end
|
||||
end
|
||||
|
||||
function Cursor:clear()
|
||||
self:_draw(self.x_pos, self.y_pos)
|
||||
if not self.is_cleared then
|
||||
self.is_cleared = true
|
||||
self:_draw(self.x_pos, self.y_pos)
|
||||
end
|
||||
end
|
||||
|
||||
function Cursor:move(x_off, y_off)
|
||||
|
||||
Reference in New Issue
Block a user