Authored by Justin R. Miller

add fill pattern image to RMShape

... ... @@ -66,6 +66,9 @@
/** The fill color of the shape. Defaults to clear. */
@property (nonatomic, strong) UIColor *fillColor;
/** The fill pattern image of the shape. If set, the fillColor is set to `nil`. */
@property (nonatomic, strong) UIImage *fillPatternImage;
@property (nonatomic, weak) NSArray *lineDashLengths;
@property (nonatomic, assign) CGFloat lineDashPhase;
@property (nonatomic, assign) BOOL scaleLineDash;
... ...
... ... @@ -123,6 +123,8 @@
shapeLayer.lineWidth = scaledLineWidth;
shapeLayer.fillColor = [[UIColor colorWithPatternImage:self.fillPatternImage] CGColor];
if (lineDashLengths)
{
if (scaleLineDash)
... ... @@ -516,6 +518,18 @@
}
}
- (void)setFillPatternImage:(UIImage *)fillPatternImage
{
if (fillPatternImage)
self.fillColor = nil;
if (_fillPatternImage != fillPatternImage)
{
_fillPatternImage = fillPatternImage;
[self recalculateGeometryAnimated:NO];
}
}
- (CGFloat)shadowBlur
{
return shapeLayer.shadowRadius;
... ...