fix compile error in Xcode 10.2

This commit is contained in:
Yonat Sharon 2019-05-29 20:53:58 +03:00
parent 03708ab870
commit 5017084681
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- fix compile error in Xcode 10.2
## [1.3.2]
### Added

View File

@ -134,7 +134,7 @@ extension Int {
private func layoutLevel() {
var levelFrame = bodyOutline.bounds.insetBy(dx: bodyOutline.borderWidth, dy: bodyOutline.borderWidth)
if level >= 0 && level <= .fullBattery {
let levelInset = (isVertical ? levelFrame.height : levelFrame.width) * CGFloat(.fullBattery - level) / CGFloat(.fullBattery)
let levelInset = (isVertical ? levelFrame.height : levelFrame.width) * CGFloat(.fullBattery - level) / CGFloat(Int.fullBattery)
(_, levelFrame) = levelFrame.divided(atDistance: levelInset, from: direction)
}
levelFill.frame = levelFrame.integral