fix compile error in Xcode 10.2
This commit is contained in:
parent
03708ab870
commit
5017084681
|
@ -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/)
|
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).
|
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]
|
## [1.3.2]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -134,7 +134,7 @@ extension Int {
|
||||||
private func layoutLevel() {
|
private func layoutLevel() {
|
||||||
var levelFrame = bodyOutline.bounds.insetBy(dx: bodyOutline.borderWidth, dy: bodyOutline.borderWidth)
|
var levelFrame = bodyOutline.bounds.insetBy(dx: bodyOutline.borderWidth, dy: bodyOutline.borderWidth)
|
||||||
if level >= 0 && level <= .fullBattery {
|
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)
|
(_, levelFrame) = levelFrame.divided(atDistance: levelInset, from: direction)
|
||||||
}
|
}
|
||||||
levelFill.frame = levelFrame.integral
|
levelFill.frame = levelFrame.integral
|
||||||
|
|
Loading…
Reference in New Issue