File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -1008,21 +1008,23 @@ func (c *Canvas) partOfHorizontalLine(i Index) bool {
10081008func (c * Canvas ) partOfDiagonalLine (i Index ) bool {
10091009 r := c .runeAt (i )
10101010
1011- nWest := c .runeAt (i .nWest ())
1012- sEast := c .runeAt (i .sEast ())
1013- nEast := c .runeAt (i .nEast ())
1014- sWest := c .runeAt (i .sWest ())
1011+ n := c .runeAt (i .north ())
1012+ s := c .runeAt (i .south ())
1013+ nw := c .runeAt (i .nWest ())
1014+ se := c .runeAt (i .sEast ())
1015+ ne := c .runeAt (i .nEast ())
1016+ sw := c .runeAt (i .sWest ())
10151017
10161018 switch r {
10171019 // Diagonal segments can be connected to joint or other segments.
10181020 case '/' :
1019- return nEast == r || sWest == r || isJoint (nEast ) || isJoint (sWest )
1021+ return ne == r || sw == r || isJoint (ne ) || isJoint (sw ) || n == '\\' || s == '\\'
10201022 case '\\' :
1021- return nWest == r || sEast == r || isJoint (nWest ) || isJoint (sEast )
1023+ return nw == r || se == r || isJoint (nw ) || isJoint (se ) || n == '/' || s == '/'
10221024
10231025 // For everything else just check if we have segments next to us.
10241026 default :
1025- return nWest == '\\' || nEast == '/' || sWest == '/' || sEast == '\\'
1027+ return nw == '\\' || ne == '/' || sw == '/' || se == '\\'
10261028 }
10271029}
10281030
You can’t perform that action at this time.
0 commit comments