From 8e753bfbbe8dde3d8ebd42cb0ebd83e14214826d Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Sun, 4 Aug 2024 13:29:34 +0200 Subject: [PATCH] Fix text align property docs (#256) --- docs/tildagon-apps/reference/ctx.md | 16 ++++++++-------- docs/tildagon-apps/reference/ui-elements.md | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/tildagon-apps/reference/ctx.md b/docs/tildagon-apps/reference/ctx.md index 0605c56..cad11f5 100644 --- a/docs/tildagon-apps/reference/ctx.md +++ b/docs/tildagon-apps/reference/ctx.md @@ -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. diff --git a/docs/tildagon-apps/reference/ui-elements.md b/docs/tildagon-apps/reference/ui-elements.md index ed24901..50d6e20 100644 --- a/docs/tildagon-apps/reference/ui-elements.md +++ b/docs/tildagon-apps/reference/ui-elements.md @@ -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() @@ -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()