Commit e3ceff6f authored by sanmarcos's avatar sanmarcos Committed by Felix Paul Kühne

Fix a bug where brightness could be 101% or -1%

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 191e7405
......@@ -1192,6 +1192,14 @@
else
brightness = brightness + 0.01;
// Sanity check since -[UIScreen brightness] does not go by 0.01 steps
if (brightness > 1.0)
brightness = 1.0;
else if (brightness < 0.0)
brightness = 0.0;
NSAssert(brightness >= 0 && brightness <= 1, @"Brightness must be within 0 and 1 (it is %f)", brightness);
[[UIScreen mainScreen] setBrightness:brightness];
self.brightnessSlider.value = brightness * 2.;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment