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:
authorCampbell Barton <ideasman42@gmail.com>2018-12-21 11:17:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-21 11:25:56 +0300
commitcded90f989ee3acb1b8006a767d67dea361cb4e5 (patch)
tree4cddbdfc75f30ad6be85546b66852c342f21de6e /source/blender/editors/space_view3d
parent890507d12f5cbcc336000a4847a52da3f8020bac (diff)
Fix T59709: Light target gizmo scaling
Gizmo was scaling w/ object.
Diffstat (limited to 'source/blender/editors/space_view3d')
-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);
}