mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-15 10:48:04 +00:00
Compare commits
3 Commits
cb5e53ca05
...
203035cc17
Author | SHA1 | Date | |
---|---|---|---|
|
203035cc17 | ||
|
06167b4f4b | ||
|
fa0e566438 |
12
README.md
12
README.md
@ -1787,7 +1787,8 @@ Note: when using the debug tools, their internal colors are represented as 0-255
|
||||
|
||||
```C
|
||||
typedef struct {
|
||||
int length;
|
||||
bool isStaticallyAllocated;
|
||||
int32_t length;
|
||||
const char *chars;
|
||||
} Clay_String;
|
||||
```
|
||||
@ -1796,7 +1797,14 @@ typedef struct {
|
||||
|
||||
**Fields**
|
||||
|
||||
**`.length`** - `int`
|
||||
**`.isStaticallyAllocated`** - `bool`
|
||||
|
||||
Whether or not the string is statically allocated, or in other words, whether
|
||||
or not it lives for the entire lifetime of the program.
|
||||
|
||||
---
|
||||
|
||||
**`.length`** - `int32_t`
|
||||
|
||||
The number of characters in the string, _not including an optional null terminator._
|
||||
|
||||
|
6
clay.h
6
clay.h
@ -4118,11 +4118,15 @@ Clay_ScrollContainerData Clay_GetScrollContainerData(Clay_ElementId id) {
|
||||
for (int32_t i = 0; i < context->scrollContainerDatas.length; ++i) {
|
||||
Clay__ScrollContainerDataInternal *scrollContainerData = Clay__ScrollContainerDataInternalArray_Get(&context->scrollContainerDatas, i);
|
||||
if (scrollContainerData->elementId == id.id) {
|
||||
Clay_ScrollElementConfig *scrollElementConfig = Clay__FindElementConfigWithType(scrollContainerData->layoutElement, CLAY__ELEMENT_CONFIG_TYPE_SCROLL).scrollElementConfig;
|
||||
if (!scrollElementConfig) { // This can happen on the first frame before a scroll container is declared
|
||||
return CLAY__INIT(Clay_ScrollContainerData) CLAY__DEFAULT_STRUCT;
|
||||
}
|
||||
return CLAY__INIT(Clay_ScrollContainerData) {
|
||||
.scrollPosition = &scrollContainerData->scrollPosition,
|
||||
.scrollContainerDimensions = { scrollContainerData->boundingBox.width, scrollContainerData->boundingBox.height },
|
||||
.contentDimensions = scrollContainerData->contentSize,
|
||||
.config = *Clay__FindElementConfigWithType(scrollContainerData->layoutElement, CLAY__ELEMENT_CONFIG_TYPE_SCROLL).scrollElementConfig,
|
||||
.config = *scrollElementConfig,
|
||||
.found = true
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user