Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

One mistake #16

Open
YaHoYii opened this issue Oct 30, 2018 · 1 comment
Open

One mistake #16

YaHoYii opened this issue Oct 30, 2018 · 1 comment

Comments

@YaHoYii
Copy link

YaHoYii commented Oct 30, 2018

I found a mistake in the UIBezierPath+WeightedPoint.swift file,https://github.com/uber/UberSignature/blob/master/Sources/Swift/Internal/UIBezierPath%2BWeightedPoint.swift
Original code

 class func line(withWeightedPointA pointA: WeightedPoint, pointB: WeightedPoint) -> UIBezierPath {
        let lines = linesPerpendicularToLine(from: pointA, to: pointB)
        
        let path = UIBezierPath()
        path.move(to: lines.0.startPoint)
        path.addLine(to: lines.1.startPoint)
        path.addLine(to: lines.1.endPoint)
        **path.addLine(to: lines.0. startPoint)**
        path.close()
        
        return path
    }

Sometimes it causes the drawn lines to be jagged.
I read the code of Objects-C,It should be changed to solve this problem.

    class func line(withWeightedPointA pointA: WeightedPoint, pointB: WeightedPoint) -> UIBezierPath {
        let lines = linesPerpendicularToLine(from: pointA, to: pointB)
        
        let path = UIBezierPath()
        path.move(to: lines.0.startPoint)
        path.addLine(to: lines.1.startPoint)
        path.addLine(to: lines.1.endPoint)
        **path.addLine(to: lines.0.endPoint)**
        path.close()
        
        return path
    }

You can confirm this question.

rpstro02 pushed a commit to rpstro02/UberSignature that referenced this issue Jun 26, 2019
@rpstro02
Copy link

This is a duplicate of Issue #7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants