Compare commits

..

1 Commits

Author SHA1 Message Date
tomat
47799a01f2
Merge d0d1e01a3f into a5983dee96 2025-02-10 00:55:31 -06:00

10
clay.h
View File

@ -3521,19 +3521,13 @@ CLAY_WASM_EXPORT("Clay_EndLayout")
Clay_RenderCommandArray Clay_EndLayout(void) {
Clay_Context* context = Clay_GetCurrentContext();
Clay__CloseElement();
bool elementsExceededBeforeDebugView = context->booleanWarnings.maxElementsExceeded;
if (context->debugModeEnabled && !elementsExceededBeforeDebugView) {
if (context->debugModeEnabled) {
context->warningsEnabled = false;
Clay__RenderDebugView();
context->warningsEnabled = true;
}
if (context->booleanWarnings.maxElementsExceeded) {
Clay_String message;
if (!elementsExceededBeforeDebugView) {
message = CLAY_STRING("Clay Error: Layout elements exceeded Clay__maxElementCount after adding the debug-view to the layout.");
} else {
message = CLAY_STRING("Clay Error: Layout elements exceeded Clay__maxElementCount");
}
Clay_String message = CLAY_STRING("Clay Error: Layout elements exceeded Clay__maxElementCount");
Clay__AddRenderCommand(CLAY__INIT(Clay_RenderCommand ) {
.boundingBox = { context->layoutDimensions.width / 2 - 59 * 4, context->layoutDimensions.height / 2, 0, 0 },
.renderData = { .text = { .stringContents = CLAY__INIT(Clay_StringSlice) { .length = message.length, .chars = message.chars, .baseChars = message.chars }, .textColor = {255, 0, 0, 255}, .fontSize = 16 } },