fix crash in light textures example

This commit is contained in:
robtfm 2025-07-16 12:10:24 +01:00
parent 8e14d99fb9
commit e270e98fb0

View File

@ -540,14 +540,16 @@ fn process_scale_input(
for (mut transform, selection) in &mut scale_selections {
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 {
if app_status.selection == *selection {
spotlight.outer_angle =
(spotlight.outer_angle * (1.0 + mouse_motion.delta.x * SCALE_SPEED)).min(FRAC_PI_4);
spotlight.outer_angle = (spotlight.outer_angle
* (1.0 + mouse_motion.delta.x * SCALE_SPEED))
.clamp(0.01, FRAC_PI_4);
spotlight.inner_angle = spotlight.outer_angle;
}
}