Skip to content
  • Benjamin Otte's avatar
    power: Fix rounding of brightness value · db374936
    Benjamin Otte authored
    We rounded properly for percentage to absolute value, but we always floored the other way around.
    
    The new code achieves this by always rounding. This way the following rule holds (assuming the the min value is 0 for this discussion)
      x = round (round (x * scale) / scale)
    with
      scale = (max - min) / 100
    and assuming that scale >= 1
    
    If scale < 1, the rule holds for the other direction.
    db374936