From c9164f7af0661fae28772200992436cd27e4f93b Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 2 Dec 2025 13:23:37 -0500 Subject: pke: font center vertical --- tests/pke-test-font.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/pke-test-font.cpp b/tests/pke-test-font.cpp index b4a1235..3ecd694 100644 --- a/tests/pke-test-font.cpp +++ b/tests/pke-test-font.cpp @@ -526,7 +526,8 @@ int pke_test_font_007() { coord.y *= 1080.f/2.f; PK_TEST_ASSERT_GTE_RET(2.98, coord.x); PK_TEST_ASSERT_LTE_RET(2.99, coord.x); - // tmp = coord.x; + PK_TEST_ASSERT_GTE_RET(139.86f, coord.y); + PK_TEST_ASSERT_LTE_RET(139.87f, coord.y); // bottom right coord = fibis[12].pos_scale * glm::vec4(pkeIntrinsicsPlane.vert[2], 0, 1); @@ -536,11 +537,14 @@ int pke_test_font_007() { coord.y *= 1080.f/2.f; PK_TEST_ASSERT_GTE_RET(2.98, frs.surface_area_size.x-coord.x); PK_TEST_ASSERT_LTE_RET(2.99, frs.surface_area_size.x-coord.x); - PK_TEST_ASSERT_GTE_RET(frs.surface_area_size.x-3, coord.x); - PK_TEST_ASSERT_LTE_RET(frs.surface_area_size.x-2, coord.x); + // I'm not 100% sure why these differ from above. + // However, a manual test reveals that this value is correct. + // using the test project, center some text and change its container's + // size; the text will remain in the same position (center box too). + PK_TEST_ASSERT_GTE_RET(151.11f, frs.surface_area_size.y-coord.y); + PK_TEST_ASSERT_LTE_RET(151.12f, frs.surface_area_size.y-coord.y); } - return 0; } -- cgit v1.2.3