From 67fb684279f354747a5c88181542db129efbc490 Mon Sep 17 00:00:00 2001 From: Liu Date: Sat, 10 Feb 2024 19:16:56 +0800 Subject: [PATCH] fixup! feat(pandagl): calculate baseline position based on Ascender and BBox --- lib/pandagl/src/font/bitmap.c | 12 ++++++++++++ tests/run_tests.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/pandagl/src/font/bitmap.c b/lib/pandagl/src/font/bitmap.c index 746cbf202..7267c9ceb 100644 --- a/lib/pandagl/src/font/bitmap.c +++ b/lib/pandagl/src/font/bitmap.c @@ -94,6 +94,18 @@ int pd_canvas_mix_font_bitmap(pd_canvas_t *graph, pd_pos_t pos, pd_canvas_t write_slot; pd_rect_t r_rect, w_rect; + if (pos.x > 0) { + printf("pos.x\n"); + } + if (pos.y > 0) { + printf("pos.y\n"); + } + if (pos.x > (int)graph->width) { + printf("width\n"); + } + if (pos.y > (int)graph->height) { + printf("height\n"); + } if (pos.x > (int)graph->width || pos.y > (int)graph->height) { return -2; } diff --git a/tests/run_tests.c b/tests/run_tests.c index eb40d5c84..55e723ebb 100644 --- a/tests/run_tests.c +++ b/tests/run_tests.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) { - logger_set_level(LOGGER_LEVEL_ERROR); + logger_set_level(LOGGER_LEVEL_ALL); ctest_describe("test settings", test_settings); ctest_describe("test thread", test_thread); ctest_describe("test font load", test_font_load);