We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 161bca3 commit f65348fCopy full SHA for f65348f
crates/brush-ui/src/ui_process.rs
@@ -139,7 +139,14 @@ impl UiProcess {
139
}
140
141
pub fn set_cam_fov(&self, fov_y: f64) {
142
- self.write().camera.fov_y = fov_y;
+ let mut inner = self.write();
143
+ // Scale fov_x proportionally to maintain the camera's aspect ratio.
144
+ // This allows setting FOV smaller than the dataset FOV.
145
+ let old_fov_y = inner.camera.fov_y;
146
+ let aspect = (inner.camera.fov_x / 2.0).tan() / (old_fov_y / 2.0).tan();
147
+ inner.camera.fov_y = fov_y;
148
+ inner.camera.fov_x = 2.0 * (aspect * (fov_y / 2.0).tan()).atan();
149
+ drop(inner);
150
self.read().repaint();
151
152
0 commit comments