Force canvas item update on oversampling change.

This commit is contained in:
bruvzg
2024-06-03 19:46:49 +03:00
parent 0d11108a01
commit 9fb9660912
3 changed files with 12 additions and 6 deletions

View File

@ -1096,7 +1096,7 @@ void Window::_update_viewport_size() {
Size2i final_size;
Size2i final_size_override;
Rect2i attach_to_screen_rect(Point2i(), size);
float font_oversampling = 1.0;
double font_oversampling = 1.0;
window_transform = Transform2D();
if (content_scale_stretch == Window::CONTENT_SCALE_STRETCH_INTEGER) {
@ -1215,7 +1215,7 @@ void Window::_update_viewport_size() {
}
bool allocate = is_inside_tree() && visible && (window_id != DisplayServer::INVALID_WINDOW_ID || embedder != nullptr);
_set_size(final_size, final_size_override, allocate);
bool ci_updated = _set_size(final_size, final_size_override, allocate);
if (window_id != DisplayServer::INVALID_WINDOW_ID) {
RenderingServer::get_singleton()->viewport_attach_to_screen(get_viewport_rid(), attach_to_screen_rect, window_id);
@ -1227,11 +1227,16 @@ void Window::_update_viewport_size() {
if (!use_font_oversampling) {
font_oversampling = 1.0;
}
if (TS->font_get_global_oversampling() != font_oversampling) {
if (!Math::is_equal_approx(TS->font_get_global_oversampling(), font_oversampling)) {
TS->font_set_global_oversampling(font_oversampling);
ci_updated = false;
}
}
if (!ci_updated) {
update_canvas_items();
}
notification(NOTIFICATION_WM_SIZE_CHANGED);
if (embedder) {