Skip to content

Commit 81b5b98

Browse files
committed
Fixes static analyzer warning.
1 parent 32346cb commit 81b5b98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

HMSegmentedControl/HMSegmentedControl.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ - (void)drawRect:(CGRect)rect {
236236

237237
CGFloat y = roundf(CGRectGetHeight(self.frame) - self.selectionIndicatorHeight)/2 - stringHeight/2 + ((self.selectionIndicatorLocation == HMSegmentedControlSelectionIndicatorLocationUp) ? self.selectionIndicatorHeight : 0);
238238

239-
CGRect rect,rectDiv, fullRect;
239+
CGRect rect = CGRectZero;
240+
CGRect rectDiv;
241+
CGRect fullRect;
240242
if (self.segmentWidthStyle == HMSegmentedControlSegmentWidthStyleFixed) {
241243
rect = CGRectMake((self.segmentWidth * idx) + (self.segmentWidth - stringWidth) / 2, y, stringWidth, stringHeight);
242244
rectDiv = CGRectMake((self.segmentWidth * idx) - (self.verticalDividerWidth / 2), self.selectionIndicatorHeight * 2, self.verticalDividerWidth, self.frame.size.height - (self.selectionIndicatorHeight * 4));

0 commit comments

Comments
 (0)