From 45e60ee36cdd52bb78afb176c86027407a009de6 Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Thu, 26 Dec 2024 19:55:16 +1300 Subject: [PATCH] Throw in a tiny fix for the debug tools element highlight punching through --- clay.h | 4 +++- examples/cpp-project-example/main.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clay.h b/clay.h index 9c75a9c..48b5e32 100644 --- a/clay.h +++ b/clay.h @@ -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; } diff --git a/examples/cpp-project-example/main.cpp b/examples/cpp-project-example/main.cpp index ef215d9..f31e854 100644 --- a/examples/cpp-project-example/main.cpp +++ b/examples/cpp-project-example/main.cpp @@ -4,7 +4,6 @@ Clay_LayoutConfig layoutElement = Clay_LayoutConfig { .padding = {5} }; - void HandleClayErrors(Clay_ErrorData errorData) { printf("%s", errorData.errorText.chars); }