Fix oversampled font artifacts after resize

Font update after resize relies on the viewport size which was updated
after the font was already refreshed, which resulted in artifacts when
it was rendered into the actual/new viewport size.

Fixes #15173.

(cherry picked from commit 47747718d6)
This commit is contained in:
Ruslan Mustakov 2018-03-19 20:44:26 +07:00 committed by Hein-Pieter van Braam
parent 448d281222
commit 56395b03e1
1 changed files with 3 additions and 3 deletions

View File

@ -498,14 +498,14 @@ bool SceneTree::idle(float p_time) {
Size2 win_size = Size2(OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height); Size2 win_size = Size2(OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height);
if (win_size != last_screen_size) { if (win_size != last_screen_size) {
last_screen_size = win_size;
_update_root_rect();
if (use_font_oversampling) { if (use_font_oversampling) {
DynamicFontAtSize::font_oversampling = OS::get_singleton()->get_window_size().width / root->get_visible_rect().size.width; DynamicFontAtSize::font_oversampling = OS::get_singleton()->get_window_size().width / root->get_visible_rect().size.width;
DynamicFont::update_oversampling(); DynamicFont::update_oversampling();
} }
last_screen_size = win_size;
_update_root_rect();
emit_signal("screen_resized"); emit_signal("screen_resized");
} }