Hallo,
ich habe folgendes Code-Fragment, um eine zusammenhängende Linie zeichnen (etwas vereinfacht auf dem Foto abgebildet - enthält eigentlich mehr Elemente, so dass CGContextAddRect() nicht anwendbar wäre):
Alles anzeigen
Was ich nicht verstehe ist, dass die rechte Linie - auch bei mehreren Elementen, die doppelte Breite aufweist, als alle anderen Linien. Woran mag das liegen?
Danke!
ich habe folgendes Code-Fragment, um eine zusammenhängende Linie zeichnen (etwas vereinfacht auf dem Foto abgebildet - enthält eigentlich mehr Elemente, so dass CGContextAddRect() nicht anwendbar wäre):
Quellcode
- CGContextSaveGState(inContext);
- CGContextSetLineWidth(inContext, 10.0f);
- CGContextSetLineJoin(inContext, kCGLineJoinRound);
- CGContextSetLineCap(inContext, kCGLineCapRound);
- CGContextSetGrayStrokeColor(inContext, 1.0f, 1.0f);
- CGContextBeginPath(inContext);
- CGContextMoveToPoint(inContext, x1, y1 );
- CGContextAddLineToPoint(inContext, x2, y2 );
- CGContextAddLineToPoint(inContext, x3, y3 );
- CGContextAddLineToPoint(inContext, x4, y4 );
- CGContextClosePath(inContext);
- CGContextStrokePath(inContext);
- CGContextRestoreGState(inContext);
Was ich nicht verstehe ist, dass die rechte Linie - auch bei mehreren Elementen, die doppelte Breite aufweist, als alle anderen Linien. Woran mag das liegen?
Danke!