From a5d4940b9665298b2a7af21555c6b66ca234ac80 Mon Sep 17 00:00:00 2001 From: Yuriy Berdnikov Date: Fri, 15 Mar 2013 21:04:42 +0200 Subject: [PATCH] Update DYRateView.m Changed rating step to 0.5, so user can rate using half-star, for example 2.5 stars. --- DYRateView/DYRateView/DYRateView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DYRateView/DYRateView/DYRateView.m b/DYRateView/DYRateView/DYRateView.m index b4aeef5..ef45f62 100644 --- a/DYRateView/DYRateView/DYRateView.m +++ b/DYRateView/DYRateView/DYRateView.m @@ -169,9 +169,9 @@ - (void)setEmptyStarImage:(UIImage *)emptyStarImage } - (void)handleTouchAtLocation:(CGPoint)location { - for(int i = _numOfStars - 1; i > -1; i--) { + for(CGFloat i = _numOfStars - 0.5; i > -0.5f; i = i - 0.5f) { if (location.x > _origin.x + i * (_fullStarImage.size.width + _padding) - _padding / 2.) { - self.rate = i + 1; + self.rate = i + 0.5f; return; } }