Note that there are some explanatory texts on larger screens.

plurals
  1. POCGContextSetLineWidth(context, 1) - the width is almost alwayas at least 2 pixels instead 1
    primarykey
    data
    text
    <p>With <code>CGContextSetLineWidth(context, 1)</code> the width is almost alwayas at least 2 pixels instead 1</p> <p>QQCandleStickLayer.m</p> <pre><code>-(id)init { self = [super init]; if(self != nil) { self.delegate = self; self.opaque = NO; } return self; } - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context{ CGContextSetLineWidth(context, 1.0f); CGContextSetAllowsAntialiasing(context, false); CGContextSetShouldAntialias(context, false); CGContextSetInterpolationQuality(context,kCGInterpolationNone); CGContextSetShadowWithColor(context, CGSizeMake( 0.0, 0.0 ), 0, NULL); CGContextMoveToPoint(context, self.bounds.origin.x+30.5f, self.bounds.origin.y+self.bounds.size.height-indent); CGContextAddLineToPoint(context, self.bounds.origin.x+30.5f, self.bounds.origin.y+self.bounds.size.height-(self.bounds.size.height-lastY)); CGContextClosePath(context); CGContextSetRGBStrokeColor(context, 119.0f/255, 119.0f/255, 119.0f/255, 1.0); CGContextStrokePath(context); } </code></pre> <p>QQDefluviumLayer.m</p> <pre><code>- (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context{ UIImage *myDefluvium = [UIImage imageNamed:@"delfluviumNewRotatedSmall.png"]; CGLayerRef layerCircle = CGLayerCreateWithContext(context, myDefluvium.size,NULL); if (layerCircle) { CGContextRef layerContext = CGLayerGetContext(layerCircle); CGContextDrawImage(layerContext, (CGRect){ CGPointZero, myDefluvium.size }, myDefluvium.CGImage); CGContextDrawLayerInRect(context, CGRectMake(layer.bounds.origin.x,layer.bounds.origin.y, layer.bounds.size.width,layer.bounds.size.height), layerCircle); CFRelease(layerCircle); } } </code></pre> <p>QuickQuoteViewController.m</p> <pre><code>defluviumLayer=[[QQDefluviumLayer alloc] init]; [defluviumLayer setBounds:CGRectMake(0, 0, 61, 343)]; [defluviumLayer setPosition:CGPointMake(277,246)]; [self.view.layer addSublayer:defluviumLayer]; [defluviumLayer update]; candleStickLayer=[[QQCandleStickLayer alloc] init]; [candleStickLayer setBounds:CGRectMake(0,0, defluviumLayer.frame.size.width, defluviumLayer.frame.size.height)]; [candleStickLayer setPosition:CGPointMake(defluviumLayer.position.x,defluviumLayer.position.y)]; [self.view.layer addSublayer:candleStickLayer]; [candleStickLayer update]; </code></pre> <p>I'm drawing in a CALayer, and have Image with image below layer, as I have tested - if i draw on clear white view - the line can be drawn with width 1, but not on the image</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload