This commit is contained in:
Alessandro Mauri 2025-10-13 00:26:36 +02:00
parent 3b66e51cc6
commit 5dfbad2399
2 changed files with 19 additions and 3 deletions

View File

@ -335,6 +335,18 @@ fn TextSize? Ctx.measure_string(&ctx, String text)
// character's advance value
// TODO: implement a "reflow" flag to toggle reflow if a character goes out of bounds
// TODO: also return the total bounds of the laid out string
// TODO: Following improvements
// [ ] struct LineInfo which stores the line information, like offset, width and height, during
// the measurement stage each line is scanned and pushed to the list, then to layout
// simply pop each line. The LineInfo list can be stored on the stack with the tmem allocator
// [ ] if the alignment is TOP_LEFT we can simply skip measuring the string, opting to layout
// it directly
// [ ] implement a macro to fetch and layout each character, this can be used to reduce code
// repetition both here and in measure_string
// [ ] the cursor position can be determined by a separate function like get_cursor_position()
// this way the function can terminate early if the cursor position is found
// [ ] implement a function hit_test_string() to get the character position at point, this can
// be used to implement mouse interactions, like cursor movement and selection
<*
@param [&in] ctx
@param [in] text

View File

@ -0,0 +1,4 @@
module ugui;