Merge pull request #79705 from 398utubzyt/gui/snap-charfx-fix

GUI: Snap CharFX offset to nearest pixel when setting is enabled
This commit is contained in:
Rémi Verschelde 2023-08-02 12:18:46 +02:00
commit 3e958cfa8d
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 8 additions and 0 deletions

View File

@ -1106,6 +1106,10 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
} }
} }
if (is_inside_tree() && get_viewport()->is_snap_2d_transforms_to_pixel_enabled()) {
fx_offset = fx_offset.round();
}
// Draw glyph outlines. // Draw glyph outlines.
const Color modulated_outline_color = font_outline_color * Color(1, 1, 1, font_color.a); const Color modulated_outline_color = font_outline_color * Color(1, 1, 1, font_color.a);
const Color modulated_shadow_color = font_shadow_color * Color(1, 1, 1, font_color.a); const Color modulated_shadow_color = font_shadow_color * Color(1, 1, 1, font_color.a);
@ -1329,6 +1333,10 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
} }
} }
if (is_inside_tree() && get_viewport()->is_snap_2d_transforms_to_pixel_enabled()) {
fx_offset = fx_offset.round();
}
if (selected && use_selected_font_color) { if (selected && use_selected_font_color) {
font_color = theme_cache.font_selected_color; font_color = theme_cache.font_selected_color;
} }