start remembering where the cursor is drawn in px
We'll start using this in cursor up/down motions.
This commit is contained in:
parent
5f2ef2faaf
commit
7fd3c92efe
2
main.lua
2
main.lua
|
@ -44,6 +44,8 @@ Cursor_pos = 1 -- in Unicode codepoints, from 1 to utf8.len(line) + 1
|
||||||
|
|
||||||
Screen_width, Screen_height, Screen_flags = 0, 0, nil
|
Screen_width, Screen_height, Screen_flags = 0, 0, nil
|
||||||
|
|
||||||
|
Cursor_x, Cursor_y = 0, 0 -- in pixels
|
||||||
|
|
||||||
Current_drawing_mode = 'line'
|
Current_drawing_mode = 'line'
|
||||||
Previous_drawing_mode = nil
|
Previous_drawing_mode = nil
|
||||||
|
|
||||||
|
|
2
text.lua
2
text.lua
|
@ -52,6 +52,8 @@ function Text.draw_cursor(x, y)
|
||||||
love.graphics.setColor(1,0,0)
|
love.graphics.setColor(1,0,0)
|
||||||
love.graphics.circle('fill', x,y+math.floor(15*Zoom), 2)
|
love.graphics.circle('fill', x,y+math.floor(15*Zoom), 2)
|
||||||
love.graphics.setColor(0,0,0)
|
love.graphics.setColor(0,0,0)
|
||||||
|
Cursor_x = x
|
||||||
|
Cursor_y = y+math.floor(15*Zoom)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Text.compute_fragments(line, line_width)
|
function Text.compute_fragments(line, line_width)
|
||||||
|
|
Loading…
Reference in New Issue