summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/power/power_manager.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/power/power_manager.cc b/src/power/power_manager.cc
index 4973b0c4..db0b4fc6 100644
--- a/src/power/power_manager.cc
+++ b/src/power/power_manager.cc
@@ -183,7 +183,7 @@ PlatformResult PowerManager::SetScreenBrightness(double brightness) {
return result;
}
- int platform_brightness = (int)(brightness * max_brightness_);
+ int platform_brightness = std::round(brightness * max_brightness_);
if (0 == platform_brightness) {
// The value '0' on native level is treated as setting ScreenState to "SCREEN_DIM", thus the
// brightness values come from range from 1 to max_brightness_ (which is usually equal to