This commit is contained in:
Vadim 2023-02-18 20:15:49 +03:00
parent a00d608adc
commit 26fdd0cfd0

View file

@ -122,19 +122,9 @@ class MeteringBloc extends Bloc<MeteringEvent, MeteringState> {
} }
List<ExposurePair> _buildExposureValues(double ev) { List<ExposurePair> _buildExposureValues(double ev) {
late final int evSteps; /// Depending on the `stopType` the exposure pairs list length is multiplied by 1,2 or 3
switch (stopType) { final int evSteps = (ev * (stopType.index + 1)).round();
case StopType.full: final int evOffset =
evSteps = ev.floor();
break;
case StopType.half:
evSteps = (ev / 0.5).floor();
break;
case StopType.third:
evSteps = (ev / 0.3).floor();
break;
}
final evOffset =
_shutterSpeedValues.indexOf(const ShutterSpeedValue(1, false, StopType.full)) - evSteps; _shutterSpeedValues.indexOf(const ShutterSpeedValue(1, false, StopType.full)) - evSteps;
late final int apertureOffset; late final int apertureOffset;
@ -147,7 +137,7 @@ class MeteringBloc extends Bloc<MeteringEvent, MeteringState> {
shutterSpeedOffset = 0; shutterSpeedOffset = 0;
} }
int itemsCount = min(_apertureValues.length + shutterSpeedOffset, final int itemsCount = min(_apertureValues.length + shutterSpeedOffset,
_shutterSpeedValues.length + apertureOffset) - _shutterSpeedValues.length + apertureOffset) -
max(apertureOffset, shutterSpeedOffset); max(apertureOffset, shutterSpeedOffset);