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

Method print

path_intersection.go:673–705  ·  view source on GitHub ↗
(w io.Writer, prefix string, cmp int)

Source from the content-addressed store, hash-verified

671}
672
673func (n *SweepNode) print(w io.Writer, prefix string, cmp int) {
674 c := ""
675 if cmp < 0 {
676 c = "│ "
677 } else if 0 < cmp {
678 c = " "
679 }
680 if n.right != nil {
681 n.right.print(w, prefix+c, 1)
682 } else if n.left != nil {
683 fmt.Fprintf(w, "%v%v┌─nil\n", prefix, c)
684 }
685
686 c = ""
687 if 0 < cmp {
688 c = "┌─"
689 } else if cmp < 0 {
690 c = "└─"
691 }
692 fmt.Fprintf(w, "%v%v%v\n", prefix, c, n.SweepPoint)
693
694 c = ""
695 if 0 < cmp {
696 c = "│ "
697 } else if cmp < 0 {
698 c = " "
699 }
700 if n.left != nil {
701 n.left.print(w, prefix+c, -1)
702 } else if n.right != nil {
703 fmt.Fprintf(w, "%v%v└─nil\n", prefix, c)
704 }
705}
706
707func (n *SweepNode) Print(w io.Writer) {
708 n.print(w, "", 0)

Callers 1

PrintMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected