MCPcopy Create free account
hub / github.com/tdewolff/canvas / CompareH

Method CompareH

path_intersection.go:1011–1029  ·  view source on GitHub ↗
(b *SweepPoint)

Source from the content-addressed store, hash-verified

1009}
1010
1011func (a *SweepPoint) CompareH(b *SweepPoint) int {
1012 // used for nodes in tolerance square so that a.X==b.X and a.Y==b.Y
1013 // sort left-to-right, then bottom-to-top, then right-endpoints before left-endpoints, and then
1014 // sort upwards to ensure a CCW orientation of the result
1015 //if a.X < b.X {
1016 // return -1
1017 //} else if b.X < a.X {
1018 // return 1
1019 //} else if a.Y < b.Y {
1020 // return -1
1021 //} else if b.Y < a.Y {
1022 // return 1
1023 if !a.left && b.left {
1024 return -1
1025 } else if a.left && !b.left {
1026 return 1
1027 }
1028 return a.compareTangentsV(b)
1029}
1030
1031func (a *SweepPoint) compareOverlapsV(b *SweepPoint) int {
1032 // compare segments vertically that overlap (ie. are the same)

Callers

nothing calls this directly

Calls 1

compareTangentsVMethod · 0.95

Tested by

no test coverage detected