Skip to content

Commit 955188a

Browse files
committed
Merge pull request #104284 from Calinou/doc-richtextlabel-fgcolor-bgcolor-overlap
Document RichTextLabel `fgcolor` and `bgcolor` padding behavior (and risk of overlap)
2 parents a57c38c + 0b4cda7 commit 955188a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/classes/RichTextLabel.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@
341341
<param index="0" name="bgcolor" type="Color" />
342342
<description>
343343
Adds a [code skip-lint][bgcolor][/code] tag to the tag stack.
344+
[b]Note:[/b] The background color has padding applied by default, which is controlled using [theme_item text_highlight_h_padding] and [theme_item text_highlight_v_padding]. This can lead to overlapping highlights if background colors are placed on neighboring lines/columns, so consider setting those theme items to [code]0[/code] if you want to avoid this.
344345
</description>
345346
</method>
346347
<method name="push_bold">
@@ -400,6 +401,7 @@
400401
<param index="0" name="fgcolor" type="Color" />
401402
<description>
402403
Adds a [code skip-lint][fgcolor][/code] tag to the tag stack.
404+
[b]Note:[/b] The foreground color has padding applied by default, which is controlled using [theme_item text_highlight_h_padding] and [theme_item text_highlight_v_padding]. This can lead to overlapping highlights if foreground colors are placed on neighboring lines/columns, so consider setting those theme items to [code]0[/code] if you want to avoid this.
403405
</description>
404406
</method>
405407
<method name="push_font">
@@ -861,10 +863,10 @@
861863
The vertical separation of elements in a table.
862864
</theme_item>
863865
<theme_item name="text_highlight_h_padding" data_type="constant" type="int" default="3">
864-
The horizontal padding around boxes drawn by the [code][fgcolor][/code] and [code][bgcolor][/code] tags. This does not affect the appearance of text selection.
866+
The horizontal padding around boxes drawn by the [code][fgcolor][/code] and [code][bgcolor][/code] tags. This does not affect the appearance of text selection. To avoid any risk of neighboring highlights overlapping each other, set this to [code]0[/code] to disable padding.
865867
</theme_item>
866868
<theme_item name="text_highlight_v_padding" data_type="constant" type="int" default="3">
867-
The vertical padding around boxes drawn by the [code][fgcolor][/code] and [code][bgcolor][/code] tags. This does not affect the appearance of text selection.
869+
The vertical padding around boxes drawn by the [code][fgcolor][/code] and [code][bgcolor][/code] tags. This does not affect the appearance of text selection. To avoid any risk of neighboring highlights overlapping each other, set this to [code]0[/code] to disable padding.
868870
</theme_item>
869871
<theme_item name="bold_font" data_type="font" type="Font">
870872
The font used for bold text.

0 commit comments

Comments
 (0)