Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_gizmo_lamp.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_lamp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_lamp.c b/source/blender/editors/space_view3d/view3d_gizmo_lamp.c
index 88da7d0b4f4..c4e93234aa5 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_lamp.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_lamp.c
@@ -301,9 +301,17 @@ static void WIDGETGROUP_lamp_target_draw_prepare(const bContext *C, wmGizmoGroup
Object *ob = OBACT(view_layer);
wmGizmo *gz = wwrapper->gizmo;
- copy_m4_m4(gz->matrix_basis, ob->obmat);
+ normalize_m4_m4(gz->matrix_basis, ob->obmat);
unit_m4(gz->matrix_offset);
- gz->matrix_offset[3][2] = -2.4f / gz->scale_basis;
+
+ if (ob->type == OB_LAMP) {
+ Lamp *la = ob->data;
+ if (la->type == LA_SPOT) {
+ /* Draw just past the lamp size angle gizmo. */
+ madd_v3_v3fl(gz->matrix_basis[3], gz->matrix_basis[2], -la->spotsize);
+ }
+ }
+ gz->matrix_offset[3][2] -= 23.0;
WM_gizmo_set_flag(gz, WM_GIZMO_DRAW_OFFSET_SCALE, true);
}