diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-04-01 16:48:40 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-04-01 18:12:29 -0700 |
commit | 24a732ebff281dd2dee5f906b4b949315cdd018f (patch) | |
tree | ec55cffd5bf0eb7d7e8b6350fba7283aa6976aec | |
parent | ed27b8dd8582d871fa936621049c6f77cfdccb29 (diff) | |
download | lines.love-24a732ebff281dd2dee5f906b4b949315cdd018f.tar.gz |
update documentation on fragments
I see a path to at least maintain a single fragment per screen line. But can we do better? It even seems unnecessary to maintain two copies of the data, chopped up into lines and screen lines.
-rw-r--r-- | edit.lua | 2 | ||||
-rw-r--r-- | source_edit.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua index e8ce5a5..9a198f3 100644 --- a/edit.lua +++ b/edit.lua @@ -53,7 +53,7 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c -- rendering wrapped text lines needs some additional short-lived data per line: -- startpos, the index of data the line starts rendering from, can only be >1 for topmost line on screen -- starty, the y coord in pixels the line starts rendering from - -- fragments: snippets of rendered love.graphics.Text, guaranteed to not straddle screen lines + -- fragments: snippets of the line guaranteed to not straddle screen lines -- screen_line_starting_pos: optional array of grapheme indices if it wraps over more than one screen line line_cache = {}, diff --git a/source_edit.lua b/source_edit.lua index 99c2fcb..5dabee9 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -54,7 +54,7 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c -- rendering wrapped text lines needs some additional short-lived data per line: -- startpos, the index of data the line starts rendering from, can only be >1 for topmost line on screen -- starty, the y coord in pixels the line starts rendering from - -- fragments: snippets of rendered love.graphics.Text, guaranteed to not straddle screen lines + -- fragments: snippets of the line guaranteed to not straddle screen lines -- screen_line_starting_pos: optional array of grapheme indices if it wraps over more than one screen line line_cache = {}, |