From 50740c4e91a347bc28046cc1b4c9469f3f4880f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:08:35 +0200 Subject: [PATCH] Make `CharFXTransform.font` property read only, add some extra documentation notes. --- doc/classes/CharFXTransform.xml | 20 +++++++++++++------- scene/gui/rich_text_label.cpp | 1 - 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml index 28f5d38ee4c..d8700b3c6e5 100644 --- a/doc/classes/CharFXTransform.xml +++ b/doc/classes/CharFXTransform.xml @@ -25,28 +25,34 @@ [/codeblock] - Font resource used to render glyph. + [TextServer] RID of the font used to render glyph, this value can be used with [code]TextServer.font_*[/code] methods to retrieve font information. + [b]Note:[/b] Read-only. Setting this property won't affect drawing. - Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. Setting this property won't affect drawing. + Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. + [b]Note:[/b] Read-only. Setting this property won't affect drawing. - Glyph flags. See [enum TextServer.GraphemeFlag] for more info. Setting this property won't affect drawing. + Glyph flags. See [enum TextServer.GraphemeFlag] for more info. + [b]Note:[/b] Read-only. Setting this property won't affect drawing. - Font specific glyph index. + Glyph index specific to the [member font]. If you want to replace this glyph, use [method TextServer.font_get_glyph_index] with [member font] to get a new glyph index for a single character. The position offset the character will be drawn with (in pixels). - If [code]true[/code], FX transform is called for outline drawing. Setting this property won't affect drawing. + If [code]true[/code], FX transform is called for outline drawing. + [b]Note:[/b] Read-only. Setting this property won't affect drawing. - Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. + Absolute character range in the string, corresponding to the glyph. + [b]Note:[/b] Read-only. Setting this property won't affect drawing. - The character offset of the glyph, relative to the current [RichTextEffect] custom block. Setting this property won't affect drawing. + The character offset of the glyph, relative to the current [RichTextEffect] custom block. + [b]Note:[/b] Read-only. Setting this property won't affect drawing. The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects. diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 6475dc50e8e..52d91709b07 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1224,7 +1224,6 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o char_xform = charfx->transform; fx_offset = charfx->offset; font_color = charfx->color; - frid = charfx->font; gl = charfx->glyph_index; txt_visible &= charfx->visibility; }