私はCGContextSetLineDash
で破線を描こうとしています。CGContextSetLineDashで破線を描く
ここに私のコードです:
float dashPhase = 0.0;
float dashLengths[] = {30, 30};
CGContextSetLineDash(context, dashPhase, dashLengths, 20.0);
self.previousPoint2 = self.previousPoint1;
self.previousPoint1 = previous;
self.currentPoint = current;
self.mid1 = [self pointBetween:self.previousPoint1 andPoint:self.previousPoint2];
self.mid2 = [self pointBetween:self.currentPoint andPoint:self.previousPoint1];
UIBezierPath* newPath = [UIBezierPath bezierPath];
[newPath moveToPoint:self.mid1];
[newPath addLineToPoint:self.mid2];
[newPath setLineWidth:self.brushSize];
私はゆっくり描く場合は、彼らはラインが(下の画像の上を参照)は表示されませんが、私はすぐに描画した場合、彼らは(下の画像の一番下を参照してください表示されない破線)。
なぜこの出来事はありますか?
これはXcodeにどのように関連しているのでしょうか。 –