Skip to content

Commit 9325b1b

Browse files
committed
Move Lock View Rotation label logic out of process notification
1 parent de463e0 commit 9325b1b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

editor/scene/3d/node_3d_editor_plugin.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3337,11 +3337,6 @@ void Node3DEditorViewport::_notification(int p_what) {
33373337
frame_time_gradient->get_color_at_offset(
33383338
Math::remap(fps, 110, 10, 0, 1)));
33393339
}
3340-
3341-
if (lock_rotation) {
3342-
float locked_half_width = locked_label->get_size().width / 2.0f;
3343-
locked_label->set_anchor_and_offset(SIDE_LEFT, 0.5f, -locked_half_width);
3344-
}
33453340
} break;
33463341

33473342
case NOTIFICATION_PHYSICS_PROCESS: {
@@ -4079,6 +4074,12 @@ void Node3DEditorViewport::_update_centered_labels() {
40794074
float cinema_half_width = cinema_label->get_size().width / 2.0f;
40804075
cinema_label->set_anchor_and_offset(SIDE_LEFT, 0.5f, -cinema_half_width);
40814076
}
4077+
4078+
if (locked_label->is_visible()) {
4079+
locked_label->reset_size();
4080+
float locked_half_width = locked_label->get_size().width / 2.0f;
4081+
locked_label->set_anchor_and_offset(SIDE_LEFT, 0.5f, -locked_half_width);
4082+
}
40824083
}
40834084

40844085
void Node3DEditorViewport::_init_gizmo_instance(int p_idx) {

0 commit comments

Comments
 (0)