Skip to content

Commit 83d54ab

Browse files
committed
Merge pull request godotengine#96708 from bruvzg/lbl3d_os
[Label3D] Fix updating labels in subvieports on oversampling change.
2 parents cc52112 + bdd5117 commit 83d54ab

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

scene/3d/label_3d.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "label_3d.h"
3232

33-
#include "scene/main/viewport.h"
33+
#include "scene/main/window.h"
3434
#include "scene/resources/theme.h"
3535
#include "scene/theme/theme_db.h"
3636

@@ -197,14 +197,14 @@ void Label3D::_notification(int p_what) {
197197
if (!pending_update) {
198198
_im_update();
199199
}
200-
Viewport *viewport = get_viewport();
201-
ERR_FAIL_NULL(viewport);
202-
viewport->connect("size_changed", callable_mp(this, &Label3D::_font_changed));
200+
Window *window = get_window();
201+
ERR_FAIL_NULL(window);
202+
window->connect("size_changed", callable_mp(this, &Label3D::_font_changed));
203203
} break;
204204
case NOTIFICATION_EXIT_TREE: {
205-
Viewport *viewport = get_viewport();
206-
ERR_FAIL_NULL(viewport);
207-
viewport->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
205+
Window *window = get_window();
206+
ERR_FAIL_NULL(window);
207+
window->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
208208
} break;
209209
case NOTIFICATION_TRANSLATION_CHANGED: {
210210
String new_text = atr(text);

scene/main/window.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,7 @@ void Window::_update_viewport_size() {
12231223
TS->font_set_global_oversampling(font_oversampling);
12241224
if (!ci_updated) {
12251225
update_canvas_items();
1226+
emit_signal(SNAME("size_changed"));
12261227
}
12271228
}
12281229
}

0 commit comments

Comments
 (0)