MCPcopy
hub / github.com/tdewolff/canvas / Equals

Method Equals

path.go:173–183  ·  view source on GitHub ↗

Equals returns true if p and q are equal within tolerance Epsilon.

(q *Path)

Source from the content-addressed store, hash-verified

171
172// Equals returns true if p and q are equal within tolerance Epsilon.
173func (p *Path) Equals(q *Path) bool {
174 if len(p.d) != len(q.d) {
175 return false
176 }
177 for i := 0; i < len(p.d); i++ {
178 if !Equal(p.d[i], q.d[i]) {
179 return false
180 }
181 }
182 return true
183}
184
185// Sane returns true if the path is sane, ie. it does not have NaN or infinity values.
186func (p *Path) Sane() bool {

Callers 15

CoordsMethod · 0.45
LineToMethod · 0.45
QuadToMethod · 0.45
CubeToMethod · 0.45
ArcToMethod · 0.45
directionMethod · 0.45
CoordDirectionsMethod · 0.45
curvatureMethod · 0.45
ReverseMethod · 0.45
addCubicBezierLineFunction · 0.45
flattenQuadraticBezierFunction · 0.45
flattenSmoothCubicBezierFunction · 0.45

Calls 1

EqualFunction · 0.85

Tested by 2

TestPathEqualsFunction · 0.36
TestPathRelateFunction · 0.36