mirror of
https://github.com/nicbarker/clay.git
synced 2025-11-02 07:46:17 +00:00
Compare commits
3 commits
1f4e388b68
...
9a51edf23b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a51edf23b | ||
|
|
fd97d8179e | ||
|
|
d300cf7cef |
3
clay.h
3
clay.h
|
|
@ -1322,8 +1322,7 @@ Clay_LayoutElement* Clay__GetOpenLayoutElement(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Clay__GetParentElementId(void) {
|
uint32_t Clay__GetParentElementId(void) {
|
||||||
Clay_Context* context = Clay_GetCurrentContext();
|
return Clay__GetOpenLayoutElement()->id;
|
||||||
return Clay_LayoutElementArray_Get(&context->layoutElements, Clay__int32_tArray_GetValue(&context->openLayoutElementStack, context->openLayoutElementStack.length - 2))->id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Clay_LayoutConfig * Clay__StoreLayoutConfig(Clay_LayoutConfig config) { return Clay_GetCurrentContext()->booleanWarnings.maxElementsExceeded ? &CLAY_LAYOUT_DEFAULT : Clay__LayoutConfigArray_Add(&Clay_GetCurrentContext()->layoutConfigs, config); }
|
Clay_LayoutConfig * Clay__StoreLayoutConfig(Clay_LayoutConfig config) { return Clay_GetCurrentContext()->booleanWarnings.maxElementsExceeded ? &CLAY_LAYOUT_DEFAULT : Clay__LayoutConfigArray_Add(&Clay_GetCurrentContext()->layoutConfigs, config); }
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
Copyright (c) 2025 Mivirl
|
Copyright (c) 2025 Mivirl
|
||||||
|
|
||||||
|
altered by Godje (Sep 2025)
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied warranty.
|
This software is provided 'as-is', without any express or implied warranty.
|
||||||
In no event will the authors be held liable for any damages arising from the
|
In no event will the authors be held liable for any damages arising from the
|
||||||
use of this software.
|
use of this software.
|
||||||
|
|
@ -1616,6 +1618,20 @@ void Clay_Termbox_Render(Clay_RenderCommandArray commands)
|
||||||
|
|
||||||
Clay_StringSlice *text = &render_data.stringContents;
|
Clay_StringSlice *text = &render_data.stringContents;
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
|
|
||||||
|
// culling text characters that are outside of the layout
|
||||||
|
int h_clip = 0 - cell_box.x;
|
||||||
|
while(h_clip > 0 && i < text->length){
|
||||||
|
uint32_t ch = ' ';
|
||||||
|
int codepoint_length = tb_utf8_char_to_unicode(&ch, text->chars + i);
|
||||||
|
if (0 > codepoint_length) {
|
||||||
|
clay_tb_assert(false, "Invalid utf8");
|
||||||
|
}
|
||||||
|
i += codepoint_length;
|
||||||
|
h_clip -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// printing the rest of the characters
|
||||||
for (int y = box_begin_y; y < box_end_y; ++y) {
|
for (int y = box_begin_y; y < box_end_y; ++y) {
|
||||||
for (int x = box_begin_x; x < box_end_x;) {
|
for (int x = box_begin_x; x < box_end_x;) {
|
||||||
uint32_t ch = ' ';
|
uint32_t ch = ' ';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue