diff options
author | Yevgeny Makarov <jenkm> | 2020-10-28 19:03:42 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2020-10-28 19:03:42 +0300 |
commit | 683dc71c3c2db491ef79262bdaef495dfe01cf04 (patch) | |
tree | 671628adf3353e4b5c8f411a487d5c25d44d5e83 /source/blender/blenkernel/intern/image_gen.c | |
parent | 1ebb7afe1d8d5773b18778e61fe41e53578ce211 (diff) |
UI: Improve Text on 'Color Grid' Image
Change the sequence of characters shown on the 'Color Grid' generated image.
Differential Revision: https://developer.blender.org/D8603
Reviewed by Hans Goudey
Diffstat (limited to 'source/blender/blenkernel/intern/image_gen.c')
-rw-r--r-- | source/blender/blenkernel/intern/image_gen.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index 877747a257e..ceb13c4955e 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -379,10 +379,16 @@ static void checker_board_text( const float text_color[4] = {0.0, 0.0, 0.0, 1.0}; const float text_outline[4] = {1.0, 1.0, 1.0, 1.0}; + const char char_array[36] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + + int first_char_index = 0; for (y = 0; y < height; y += step) { - text[1] = '1'; + text[0] = char_array[first_char_index]; + int second_char_index = 27; for (x = 0; x < width; x += step) { + text[1] = char_array[second_char_index]; + /* hard coded offset */ pen_x = x + 33; pen_y = y + 44; @@ -412,9 +418,9 @@ static void checker_board_text( BLF_position(mono, pen_x, pen_y, 0.0); BLF_draw_buffer(mono, text, 2); - text[1]++; + second_char_index = (second_char_index + 1) % ARRAY_SIZE(char_array); } - text[0]++; + first_char_index = (first_char_index + 1) % ARRAY_SIZE(char_array); } /* cleanup the buffer. */ |