From dade40cabc272cf93afb40e1752550bd2f1007da Mon Sep 17 00:00:00 2001 From: Alexander Tovstonozhenko Date: Tue, 11 Apr 2017 17:33:07 +0300 Subject: [PATCH] Update view width calculation Previously it would add an extra `spacing` after the rightmost star. --- Pod/Classes/STRatingControl.swift | 2 +- STRatingControl.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/STRatingControl.swift b/Pod/Classes/STRatingControl.swift index 0886f0e..796fc1b 100644 --- a/Pod/Classes/STRatingControl.swift +++ b/Pod/Classes/STRatingControl.swift @@ -57,7 +57,7 @@ open class STRatingControl: UIView { return Int(self.frame.height) } fileprivate var width : Int { - return (buttonSize + spacing) * maxRating + return buttonSize * maxRating + spacing * max(0, maxRating - 1) } // MARK: Initialization diff --git a/STRatingControl.podspec b/STRatingControl.podspec index dd0e2ac..b518afa 100644 --- a/STRatingControl.podspec +++ b/STRatingControl.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "STRatingControl" - s.version = "1.1.0" + s.version = "1.1.1" s.summary = "STRatingControl is a UI control that represent the star rating control." # This description is used to generate tags and improve search results.