text rotation is sucky.
This commit is contained in:
parent
102f7a8aa3
commit
b78f2327aa
8 changed files with 140 additions and 12 deletions
16
box_test.go
16
box_test.go
|
|
@ -143,3 +143,19 @@ func TestBoxShift(t *testing.T) {
|
|||
assert.Equal(11, shifted.Right)
|
||||
assert.Equal(12, shifted.Bottom)
|
||||
}
|
||||
|
||||
func TestBoxRotate(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
b := Box{
|
||||
Top: 5,
|
||||
Left: 5,
|
||||
Right: 20,
|
||||
Bottom: 10,
|
||||
}
|
||||
rotated := b.Rotate(Math.DegreesToRadians(45))
|
||||
assert.Equal(1, rotated.Top)
|
||||
assert.Equal(4, rotated.Left)
|
||||
assert.Equal(11, rotated.Right)
|
||||
assert.Equal(15, rotated.Bottom)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue