Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Commit 51c1af1

Browse files
committed
Add rounding test cases.
1 parent 5ca4844 commit 51c1af1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

freetype_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ func TestScaling(t *testing.T) {
6767
want fixed.Int26_6
6868
}{
6969
{in: 12, want: fixed.I(12)},
70+
{in: 11.992, want: fixed.I(12) - 1},
71+
{in: 11.993, want: fixed.I(12)},
72+
{in: 12.007, want: fixed.I(12)},
73+
{in: 12.008, want: fixed.I(12) + 1},
7074
{in: 86.4, want: fixed.Int26_6(86<<6 + 26)}, // Issue https://github.com/golang/freetype/issues/85.
7175
} {
7276
c.SetFontSize(tc.in)

0 commit comments

Comments
 (0)