diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-20 07:50:33 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-20 07:50:33 -0700 |
commit | 88013000fc0445496e1c51ee869a0c36088839e2 (patch) | |
tree | 79f5261c7de4f1155c0d2f5b00ffbe23b75e57ed /text.lua | |
parent | 9f4b41d82949adbad9df0c89b3c92d8c3ac43630 (diff) | |
download | text.love-88013000fc0445496e1c51ee869a0c36088839e2.tar.gz |
.
Diffstat (limited to 'text.lua')
-rw-r--r-- | text.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/text.lua b/text.lua index 39b73d8..5a9896f 100644 --- a/text.lua +++ b/text.lua @@ -757,6 +757,7 @@ end -- convert x pixel coordinate to pos -- oblivious to wrapping +-- result: 1 to len+1 function Text.nearest_cursor_pos(line, x, left) if x == 0 then return 1 @@ -798,6 +799,7 @@ end -- return the nearest index of line (in utf8 code points) which lies entirely -- within x pixels of the left margin +-- result: 0 to len+1 function Text.nearest_pos_less_than(line, x) --? print('', '-- nearest_pos_less_than', line, x) local len = utf8.len(line) |