के साथ एक धराशायी रेखा खींचना मैं 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];
हालांकि, अगर मैं धीरे धीरे आकर्षित, वे धराशायी (नीचे छवि के शीर्ष देखें) लाइनों प्रकट नहीं होते हैं लेकिन अगर मैं जल्दी से आकर्षित, वे दिखाई देते हैं (नीचे छवि के नीचे देख)।
हो रहा क्यों है?
मुझे नहीं पता कि यह एक्सकोड से कैसे संबंधित है। –