Throw in a tiny fix for the debug tools element highlight punching through

This commit is contained in:
Nic Barker 2024-12-26 19:55:16 +13:00
parent 258993ad17
commit 45e60ee36c
2 changed files with 3 additions and 2 deletions

4
clay.h
View File

@ -3180,7 +3180,9 @@ void Clay__RenderDebugView() {
break;
}
}
int32_t highlightedRow = (int32_t)((Clay__pointerInfo.position.y - scrollYOffset) / (float)CLAY__DEBUGVIEW_ROW_HEIGHT) - 1;
int32_t highlightedRow = Clay__pointerInfo.position.y < Clay__layoutDimensions.height - 300
? (int32_t)((Clay__pointerInfo.position.y - scrollYOffset) / (float)CLAY__DEBUGVIEW_ROW_HEIGHT) - 1
: -1;
if (Clay__pointerInfo.position.x < Clay__layoutDimensions.width - (float)Clay__debugViewWidth) {
highlightedRow = -1;
}

View File

@ -4,7 +4,6 @@
Clay_LayoutConfig layoutElement = Clay_LayoutConfig { .padding = {5} };
void HandleClayErrors(Clay_ErrorData errorData) {
printf("%s", errorData.errorText.chars);
}