Skip to content

Commit

Permalink
Fix text align property docs
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Aug 4, 2024
1 parent 45f5941 commit 0d1951f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions docs/tildagon-apps/reference/ctx.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ Think of the `ctx` object as a canvas. The object stores the drawing state of th

- `font_size`: The font size to be used for text. Default: `10.0`.
- `global_alpha`: The alpha (transparency) value that is applied to shapes and images before they are drawn onto the canvas. Default: `1.0`.
- `text_align`: The alignment to be used for text. Default: `"start"`. Options:

- `"right"`: The text is right-aligned.
- `"left"`: The text is left-aligned.
- `"justify"`: The text is justified.
- `"center`: The text is centered.
- `"start"`: The text is aligned at the normal start of the line (left-aligned for left-to-right locales, right-aligned for right-to-left locales).
- `"end"`: The text is aligned at the normal end of the line (right-aligned for left-to-right locales, left-aligned for right-to-left locales).
- `text_align`: The alignment to be used for text. Default: `ctx.START`. Options:

- `ctx.RIGHT`: The text is right-aligned.
- `ctx.LEFT`: The text is left-aligned.
- `ctx.JUSTIFY`: The text is justified.
- `ctx.CENTER`: The text is centered.
- `ctx.START`: The text is aligned at the normal start of the line (left-aligned for left-to-right locales, right-aligned for right-to-left locales).
- `ctx.END`: The text is aligned at the normal end of the line (right-aligned for left-to-right locales, left-aligned for right-to-left locales).

- `text_baseline`: The baseline to be used for text. Default `"alphabetic"`. Options:
- `"alphabetic"`: The text baseline is the normal alphabetic baseline.
Expand Down
4 changes: 2 additions & 2 deletions docs/tildagon-apps/reference/ui-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ The [`TextDialog`](https://github.com/emfcamp/badge-2024-software/blob/main/modu

ctx.save()
if self.name:
ctx.text_align = "center"
ctx.text_align = ctx.CENTER
ctx.gray(1).move_to(0, 0).text("Hello " + self.name)
ctx.restore()

Expand Down Expand Up @@ -527,7 +527,7 @@ The [`TextDialog`](https://github.com/emfcamp/badge-2024-software/blob/main/modu
clear_background(ctx)

ctx.save()
ctx.text_align = "center"
ctx.text_align = ctx.CENTER
ctx.gray(1).move_to(0, 0).text("Hello " + self.name)
ctx.restore()

Expand Down

0 comments on commit 0d1951f

Please sign in to comment.