some comments
This commit is contained in:
parent
df18be7bf6
commit
c046c6af52
@ -303,6 +303,8 @@ fn TextSize? Ctx.measure_string(&ctx, String text)
|
|||||||
// layout a string inside a bounding box, following the given alignment (anchor).
|
// layout a string inside a bounding box, following the given alignment (anchor).
|
||||||
// returns the position of the cursor, the returned height is the line height and the width is the last
|
// returns the position of the cursor, the returned height is the line height and the width is the last
|
||||||
// character's advance value
|
// 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
|
||||||
fn Rect? Ctx.layout_string(&ctx, String text, Rect bounds, Anchor anchor, int z_index, Color hue, isz cursor = -1)
|
fn Rect? Ctx.layout_string(&ctx, String text, Rect bounds, Anchor anchor, int z_index, Color hue, isz cursor = -1)
|
||||||
{
|
{
|
||||||
Font* font = &ctx.font;
|
Font* font = &ctx.font;
|
||||||
|
@ -8,6 +8,10 @@ struct ElemText {
|
|||||||
TextEdit* te;
|
TextEdit* te;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Layout some text without bounds.
|
||||||
|
* There is a limitation where the current frame bounds are based on the last frame, this is usually
|
||||||
|
* not a problem but it is in the situation where the text changes almost all frames.
|
||||||
|
*/
|
||||||
macro Ctx.text(&ctx, String text, ...)
|
macro Ctx.text(&ctx, String text, ...)
|
||||||
=> ctx.text_id(@compute_id($vasplat), text);
|
=> ctx.text_id(@compute_id($vasplat), text);
|
||||||
fn void? Ctx.text_id(&ctx, Id id, String text)
|
fn void? Ctx.text_id(&ctx, Id id, String text)
|
||||||
|
@ -52,8 +52,8 @@ const char[*] FS_PATH = "resources/shaders/compiled/ugui.frag.spv";
|
|||||||
|
|
||||||
const char[*] STYLESHEET_PATH = "resources/style.css";
|
const char[*] STYLESHEET_PATH = "resources/style.css";
|
||||||
|
|
||||||
const bool LIMIT_FPS = false;
|
const bool LIMIT_FPS = true;
|
||||||
const bool VSYNC = false;
|
const bool VSYNC = true;
|
||||||
|
|
||||||
fn int main(String[] args)
|
fn int main(String[] args)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user