diff --git a/space2trees/spacebtree.go b/space2trees/spacebtree.go index 7524d5a..37622d8 100644 --- a/space2trees/spacebtree.go +++ b/space2trees/spacebtree.go @@ -1,8 +1,9 @@ package space2trees import ( - "github.com/arran4/spacemap/shared" "strconv" + + "github.com/arran4/spacemap/shared" ) type Type int @@ -174,7 +175,7 @@ func (n *Node) AvlBalance(depth int) *Node { } _ = n.RecalculateDepth(depth) nBal := n.Balance() - var cBal Balance = Balanced + var cBal = Balanced switch nBal { case Left: cBal = n.Children[0].Balance() diff --git a/space2trees/spacebtree_test.go b/space2trees/spacebtree_test.go index e113d93..5b7e08a 100644 --- a/space2trees/spacebtree_test.go +++ b/space2trees/spacebtree_test.go @@ -3,11 +3,12 @@ package space2trees import ( "bytes" "fmt" - "github.com/arran4/spacemap/shared" - "github.com/google/go-cmp/cmp" "image" "reflect" "testing" + + "github.com/arran4/spacemap/shared" + "github.com/google/go-cmp/cmp" ) func NSMBalanced(shapes ...shared.Shape) func() *Struct { @@ -1017,7 +1018,7 @@ func TestNode_InsertHere(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tt.InsertHere(tt.ZIndex, tt.Shape, tt.Type) - if diff := cmp.Diff(tt.Node.Here, tt.Expected); diff != "" { + if diff := cmp.Diff(tt.Here, tt.Expected); diff != "" { t.Errorf("Error mismatch with here and expected;\n%s", diff) } }) diff --git a/spacepartition/spacemap.go b/spacepartition/spacemap.go index 142c5ab..e300e4c 100644 --- a/spacepartition/spacemap.go +++ b/spacepartition/spacemap.go @@ -1,9 +1,10 @@ package spacepartition import ( - "github.com/arran4/spacemap/shared" "image" "sort" + + "github.com/arran4/spacemap/shared" ) type Alignment int @@ -177,7 +178,7 @@ func (m *Struct) Add(shape shared.Shape, zIndex int) { } maxyi++ } else { - m.VSplits[minxi].BecauseOf = append(m.VSplits[minxi].BecauseOf, shape) + m.VSplits[minyi].BecauseOf = append(m.VSplits[minyi].BecauseOf, shape) } if minxhs[0] != nil { for _, vs := range m.VSplits {