pocketsvg/PocketSVG

Gap/No Fill in between the Strokes in the ShapeLayer

PIRANAVARUBAN opened this issue · 2 comments

        func drawSVG(){
            let svgURL = Bundle.main.url(forResource: "test123", withExtension: "svg")!
            let paths = SVGBezierPath.pathsFromSVG(at: svgURL)
            for (index, path) in paths.enumerated() {
                let shapeLayer = CAShapeLayer()
                shapeLayer.path = path.cgPath
                shapeLayer.fillColor = UIColor.clear.cgColor
                shapeLayer.lineWidth = path.lineWidth
                shapeLayer.strokeColor = UIColor.green.cgColor
                imageLayer.addSublayer(shapeLayer)
            }
            size = SVGBoundingRectForPaths(paths).size
            imageLayer.masksToBounds = false
            self.layer.addSublayer(imageLayer)
        }

I am only giving the Path to Shape layer. and Filling Clear color to it I am drawing SVG as Above. When Strokes of the SVG varying Stroke width I am seeing a Gap Between the Strokes.
IMG_2463

Might want to provide the svg file

closing as we haven't heard back from you, but feel free to reopen with more information.