File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 33
44 Copyright (c) 2025 Mivirl
55
6+ altered by Godje (Sep 2025)
7+
68 This software is provided 'as-is', without any express or implied warranty.
79 In no event will the authors be held liable for any damages arising from the
810 use of this software.
@@ -1616,6 +1618,20 @@ void Clay_Termbox_Render(Clay_RenderCommandArray commands)
16161618
16171619 Clay_StringSlice * text = & render_data .stringContents ;
16181620 int32_t i = 0 ;
1621+
1622+ // culling text characters that are outside of the layout
1623+ int h_clip = 0 - cell_box .x ;
1624+ while (h_clip > 0 && i < text -> length ){
1625+ uint32_t ch = ' ' ;
1626+ int codepoint_length = tb_utf8_char_to_unicode (& ch , text -> chars + i );
1627+ if (0 > codepoint_length ) {
1628+ clay_tb_assert (false, "Invalid utf8" );
1629+ }
1630+ i += codepoint_length ;
1631+ h_clip -= 1 ;
1632+ }
1633+
1634+ // printing the rest of the characters
16191635 for (int y = box_begin_y ; y < box_end_y ; ++ y ) {
16201636 for (int x = box_begin_x ; x < box_end_x ;) {
16211637 uint32_t ch = ' ' ;
You can’t perform that action at this time.
0 commit comments