Skip to content

Commit 80f4674

Browse files
committed
Merge pull request #109490 from ryevdokimov/move-rotation-lock
Move `Lock View Rotation` label logic out of process notification
2 parents 638c1d7 + 9325b1b commit 80f4674

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
@@ -3433,11 +3433,6 @@ void Node3DEditorViewport::_notification(int p_what) {
34333433
frame_time_gradient->get_color_at_offset(
34343434
Math::remap(fps, 110, 10, 0, 1)));
34353435
}
3436-
3437-
if (lock_rotation) {
3438-
float locked_half_width = locked_label->get_size().width / 2.0f;
3439-
locked_label->set_anchor_and_offset(SIDE_LEFT, 0.5f, -locked_half_width);
3440-
}
34413436
} break;
34423437

34433438
case NOTIFICATION_PHYSICS_PROCESS: {
@@ -4306,6 +4301,12 @@ void Node3DEditorViewport::_update_centered_labels() {
43064301
float cinema_half_width = cinema_label->get_size().width / 2.0f;
43074302
cinema_label->set_anchor_and_offset(SIDE_LEFT, 0.5f, -cinema_half_width);
43084303
}
4304+
4305+
if (locked_label->is_visible()) {
4306+
locked_label->reset_size();
4307+
float locked_half_width = locked_label->get_size().width / 2.0f;
4308+
locked_label->set_anchor_and_offset(SIDE_LEFT, 0.5f, -locked_half_width);
4309+
}
43094310
}
43104311

43114312
void Node3DEditorViewport::_init_gizmo_instance(int p_idx) {

0 commit comments

Comments
 (0)