Skip to content

Commit

Permalink
Snap CharFX transforms to pixels when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
398utubzyt committed Jul 20, 2023
1 parent 8a9af36 commit aac2dfc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit aac2dfc

Please sign in to comment.