I have a CAShapeLayer
which contains a CGMutablePath
that has a stroke drawn around it. In my app, I transform this CAShapeLayer
to increase / decrease it's size at certain times. I'm noticing when I transform the CAShapeLayer
, the stroke
gets transformed as well. Ideally I'd like to keep the lineWidth
of the stroke
at 3 at all times even when the CAShapeLayers
transformed.
I tried shutting off the stroke before I transformed then readding it afterwards but it didn't work:
subLayerShapeLayer.lineWidth = 0;
subLayerShapeLayer.strokeColor = nil;
self.layer.sublayerTransform = CATransform3DScale(self.layer.sublayerTransform, graphicSize.width / self.graphic.size.width, graphicSize.height / self.graphic.size.height, 1);
shapeLayer.strokeColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1].CGColor;;
shapeLayer.lineWidth = 3;
Does anyone know how I might be able to accomplish this task? Seems as though it should be able to redraw the stroke after transforming somehow.