RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 405 forks source link

Invalidate cachedZoomParameters when updating configuration #195

Closed NMAC427 closed 6 years ago

NMAC427 commented 6 years ago

The cachedZoomParameters don't get invalidated when updating the configuration. That's why running this code:

fotoapparat.updateConfiguration(UpdateConfiguration(flashMode = torch()))
fotoapparat.setZoom(0.5f)

results in the torch being off. By clearing the cachedZoomParameters when calling updateConfiguration(), this piece of code results in the torch turned on (as intended).

Diolor commented 6 years ago

Thanks for finding this issue @garnele007 ! Actually I realised we don't need to cache the zoom parameters. We should directly use the camera.parameters.