if (self.segmentWidthStyle == HMSegmentedControlSegmentWidthStyleFixed) {
imageXOffset = (self.segmentWidth * idx) + (self.segmentWidth / 2.0f) - (imageWidth / 2.0f);
textXOffset = self.segmentWidth * idx;
textWidth = self.segmentWidth;
} else if (self.segmentWidthStyle == HMSegmentedControlSegmentWidthStyleDynamic) {
// When we are drawing dynamic widths, we need to loop the widths array to calculate the xOffset
CGFloat xOffset = 0;
NSInteger i = 0;
for (NSNumber *width in self.segmentWidthsArray) {
if (idx == i) {
break;
}