mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
Fix Label3D not updated on window resize.
This commit is contained in:
parent
1bb56d9298
commit
c9966db8a1
@ -31,6 +31,7 @@
|
|||||||
#include "label_3d.h"
|
#include "label_3d.h"
|
||||||
|
|
||||||
#include "core/core_string_names.h"
|
#include "core/core_string_names.h"
|
||||||
|
#include "scene/main/viewport.h"
|
||||||
#include "scene/resources/theme.h"
|
#include "scene/resources/theme.h"
|
||||||
#include "scene/scene_string_names.h"
|
#include "scene/scene_string_names.h"
|
||||||
|
|
||||||
@ -174,6 +175,14 @@ void Label3D::_notification(int p_what) {
|
|||||||
if (!pending_update) {
|
if (!pending_update) {
|
||||||
_im_update();
|
_im_update();
|
||||||
}
|
}
|
||||||
|
Viewport *viewport = get_viewport();
|
||||||
|
ERR_FAIL_COND(!viewport);
|
||||||
|
viewport->connect("size_changed", callable_mp(this, &Label3D::_font_changed));
|
||||||
|
} break;
|
||||||
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
Viewport *viewport = get_viewport();
|
||||||
|
ERR_FAIL_COND(!viewport);
|
||||||
|
viewport->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||||
String new_text = tr(text);
|
String new_text = tr(text);
|
||||||
|
Loading…
Reference in New Issue
Block a user