ScanQRcode icon indicating copy to clipboard operation
ScanQRcode copied to clipboard

二维码边框有2条上下的缝隙

Open HelloWilliam opened this issue 5 years ago • 0 comments

二维码边框有缝隙,建议多增加0.05偏移,衔接会好点

//填充矩形
        
        //扫码区域上面填充
        CGRect rect = CGRectMake(0, 0, self.frame.size.width, YMinRetangle);
        CGContextFillRect(context, rect);
        
        //扫码区域左边填充
        rect = CGRectMake(0, YMinRetangle-0.05, XRetangleLeft,sizeRetangle.height+0.1);
        CGContextFillRect(context, rect);
        
        //扫码区域右边填充
        rect = CGRectMake(XRetangleRight, YMinRetangle-0.05, XRetangleLeft,sizeRetangle.height+0.1);
        CGContextFillRect(context, rect);
        
        //扫码区域下面填充
        rect = CGRectMake(0, YMaxRetangle, self.frame.size.width,self.frame.size.height - YMaxRetangle);
        CGContextFillRect(context, rect);
        //执行绘画
        CGContextStrokePath(context);

HelloWilliam avatar Apr 24 '20 05:04 HelloWilliam