From 8accabb1e2e49cee8cf7356a98081d850a5e0e9a Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Wed, 2 Oct 2024 15:02:10 +1300 Subject: [PATCH] Remove entire erroneous if branch --- clay.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clay.h b/clay.h index 53bbbbc..8ea3ec0 100644 --- a/clay.h +++ b/clay.h @@ -3091,10 +3091,8 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) { Clay__treeNodeVisited.internalArray[dfsBuffer.length - 1] = true; Clay_LayoutElement *currentElement = Clay_LayoutElementArray_Get(&Clay__layoutElements, Clay__int32_tArray_Get(&dfsBuffer, (int)dfsBuffer.length - 1)); Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO I wish there was a way around this, maybe the fact that it's essentially a binary tree limits the cost, have to measure - if ((mapItem && Clay__PointIsInsideRect(position, mapItem->boundingBox)) || (!mapItem && Clay__PointIsInsideRect(position, CLAY__INIT(Clay_BoundingBox) {0,0, currentElement->dimensions.width, currentElement->dimensions.height}))) { - if (mapItem) { - Clay__ElementIdArray_Add(&Clay__pointerOverIds, mapItem->elementId); - } + if (mapItem && Clay__PointIsInsideRect(position, mapItem->boundingBox)) { + Clay__ElementIdArray_Add(&Clay__pointerOverIds, mapItem->elementId); if (currentElement->elementType == CLAY__LAYOUT_ELEMENT_TYPE_TEXT) { dfsBuffer.length--;