mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-15 10:48:04 +00:00
Merge 46c962d7f2
into eb46688b82
This commit is contained in:
commit
5fb3f72712
29
clay.h
29
clay.h
@ -3792,6 +3792,21 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
|
|||||||
}
|
}
|
||||||
context->pointerInfo.position = position;
|
context->pointerInfo.position = position;
|
||||||
context->pointerOverIds.length = 0;
|
context->pointerOverIds.length = 0;
|
||||||
|
|
||||||
|
if (isPointerDown) {
|
||||||
|
if (context->pointerInfo.state == CLAY_POINTER_DATA_PRESSED_THIS_FRAME) {
|
||||||
|
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED;
|
||||||
|
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_PRESSED) {
|
||||||
|
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED_THIS_FRAME;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (context->pointerInfo.state == CLAY_POINTER_DATA_RELEASED_THIS_FRAME) {
|
||||||
|
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED;
|
||||||
|
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_RELEASED) {
|
||||||
|
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED_THIS_FRAME;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Clay__int32_tArray dfsBuffer = context->layoutElementChildrenBuffer;
|
Clay__int32_tArray dfsBuffer = context->layoutElementChildrenBuffer;
|
||||||
for (int32_t rootIndex = context->layoutElementTreeRoots.length - 1; rootIndex >= 0; --rootIndex) {
|
for (int32_t rootIndex = context->layoutElementTreeRoots.length - 1; rootIndex >= 0; --rootIndex) {
|
||||||
dfsBuffer.length = 0;
|
dfsBuffer.length = 0;
|
||||||
@ -3843,20 +3858,6 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPointerDown) {
|
|
||||||
if (context->pointerInfo.state == CLAY_POINTER_DATA_PRESSED_THIS_FRAME) {
|
|
||||||
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED;
|
|
||||||
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_PRESSED) {
|
|
||||||
context->pointerInfo.state = CLAY_POINTER_DATA_PRESSED_THIS_FRAME;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (context->pointerInfo.state == CLAY_POINTER_DATA_RELEASED_THIS_FRAME) {
|
|
||||||
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED;
|
|
||||||
} else if (context->pointerInfo.state != CLAY_POINTER_DATA_RELEASED) {
|
|
||||||
context->pointerInfo.state = CLAY_POINTER_DATA_RELEASED_THIS_FRAME;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CLAY_WASM_EXPORT("Clay_Initialize")
|
CLAY_WASM_EXPORT("Clay_Initialize")
|
||||||
|
Loading…
Reference in New Issue
Block a user