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:
commit
3e958cfa8d
|
@ -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.
|
||||
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);
|
||||
|
@ -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) {
|
||||
font_color = theme_cache.font_selected_color;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue