fix crash in light textures example
This commit is contained in:
parent
8e14d99fb9
commit
e270e98fb0
@ -540,14 +540,16 @@ fn process_scale_input(
|
|||||||
|
|
||||||
for (mut transform, selection) in &mut scale_selections {
|
for (mut transform, selection) in &mut scale_selections {
|
||||||
if app_status.selection == *selection {
|
if app_status.selection == *selection {
|
||||||
transform.scale *= 1.0 + mouse_motion.delta.x * SCALE_SPEED;
|
transform.scale = (transform.scale * (1.0 + mouse_motion.delta.x * SCALE_SPEED))
|
||||||
|
.clamp(Vec3::splat(0.01), Vec3::splat(5.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (mut spotlight, selection) in &mut spotlight_selections {
|
for (mut spotlight, selection) in &mut spotlight_selections {
|
||||||
if app_status.selection == *selection {
|
if app_status.selection == *selection {
|
||||||
spotlight.outer_angle =
|
spotlight.outer_angle = (spotlight.outer_angle
|
||||||
(spotlight.outer_angle * (1.0 + mouse_motion.delta.x * SCALE_SPEED)).min(FRAC_PI_4);
|
* (1.0 + mouse_motion.delta.x * SCALE_SPEED))
|
||||||
|
.clamp(0.01, FRAC_PI_4);
|
||||||
spotlight.inner_angle = spotlight.outer_angle;
|
spotlight.inner_angle = spotlight.outer_angle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user