mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-24 07:08:03 +00:00
Compare commits
No commits in common. "08e4c5b19832c65fd9683be9036fd122a9018d08" and "47d1d84bc85734ccf9ea61828f506bc91e09e328" have entirely different histories.
08e4c5b198
...
47d1d84bc8
@ -111,6 +111,7 @@ TextElementConfig :: struct {
|
|||||||
lineHeight: u16,
|
lineHeight: u16,
|
||||||
wrapMode: TextWrapMode,
|
wrapMode: TextWrapMode,
|
||||||
textAlignment: TextAlignment,
|
textAlignment: TextAlignment,
|
||||||
|
hashStringContents: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageElementConfig :: struct {
|
ImageElementConfig :: struct {
|
||||||
|
3
clay.h
3
clay.h
@ -1670,7 +1670,6 @@ Clay_LayoutElementHashMapItem* Clay__AddHashMapItem(Clay_ElementId elementId, Cl
|
|||||||
item.nextIndex = hashItem->nextIndex;
|
item.nextIndex = hashItem->nextIndex;
|
||||||
if (hashItem->generation <= context->generation) { // First collision - assume this is the "same" element
|
if (hashItem->generation <= context->generation) { // First collision - assume this is the "same" element
|
||||||
hashItem->elementId = elementId; // Make sure to copy this across. If the stringId reference has changed, we should update the hash item to use the new one.
|
hashItem->elementId = elementId; // Make sure to copy this across. If the stringId reference has changed, we should update the hash item to use the new one.
|
||||||
hashItem->idAlias = idAlias;
|
|
||||||
hashItem->generation = context->generation + 1;
|
hashItem->generation = context->generation + 1;
|
||||||
hashItem->layoutElement = layoutElement;
|
hashItem->layoutElement = layoutElement;
|
||||||
hashItem->debugData->collision = false;
|
hashItem->debugData->collision = false;
|
||||||
@ -3811,10 +3810,10 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
|
|||||||
Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
|
Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
|
||||||
int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(currentElement - context->layoutElements.internalArray));
|
int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(currentElement - context->layoutElements.internalArray));
|
||||||
Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
|
Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
|
||||||
if (mapItem) {
|
|
||||||
Clay_BoundingBox elementBox = mapItem->boundingBox;
|
Clay_BoundingBox elementBox = mapItem->boundingBox;
|
||||||
elementBox.x -= root->pointerOffset.x;
|
elementBox.x -= root->pointerOffset.x;
|
||||||
elementBox.y -= root->pointerOffset.y;
|
elementBox.y -= root->pointerOffset.y;
|
||||||
|
if (mapItem) {
|
||||||
if ((Clay__PointIsInsideRect(position, elementBox)) && (clipElementId == 0 || (Clay__PointIsInsideRect(position, clipItem->boundingBox)))) {
|
if ((Clay__PointIsInsideRect(position, elementBox)) && (clipElementId == 0 || (Clay__PointIsInsideRect(position, clipItem->boundingBox)))) {
|
||||||
if (mapItem->onHoverFunction) {
|
if (mapItem->onHoverFunction) {
|
||||||
mapItem->onHoverFunction(mapItem->elementId, context->pointerInfo, mapItem->hoverFunctionUserData);
|
mapItem->onHoverFunction(mapItem->elementId, context->pointerInfo, mapItem->hoverFunctionUserData);
|
||||||
|
Loading…
Reference in New Issue
Block a user