mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-30 08:08:02 +00:00
Compare commits
1 Commits
d810b7d5f1
...
2d0cb3ae03
Author | SHA1 | Date | |
---|---|---|---|
|
2d0cb3ae03 |
4
clay.h
4
clay.h
@ -1842,13 +1842,12 @@ void Clay__ElementPostConfiguration(void) {
|
||||
}
|
||||
} else {
|
||||
Clay_LayoutElementHashMapItem *parentItem = Clay__GetHashMapItem(floatingConfig->parentId);
|
||||
clipElementId = Clay__int32_tArray_Get(&Clay__layoutElementClipElementIds, (int32_t)(parentItem->layoutElement - Clay__layoutElements.internalArray));
|
||||
if (!parentItem) {
|
||||
Clay__errorHandler.errorHandlerFunction(CLAY__INIT(Clay_ErrorData) {
|
||||
.errorType = CLAY_ERROR_TYPE_FLOATING_CONTAINER_PARENT_NOT_FOUND,
|
||||
.errorText = CLAY_STRING("A floating element was declared with a parentId, but no element with that ID was found."),
|
||||
.userData = Clay__errorHandler.userData });
|
||||
} else {
|
||||
clipElementId = Clay__int32_tArray_Get(&Clay__layoutElementClipElementIds, parentItem->layoutElement - Clay__layoutElements.internalArray);
|
||||
}
|
||||
}
|
||||
Clay__LayoutElementTreeRootArray_Add(&Clay__layoutElementTreeRoots, CLAY__INIT(Clay__LayoutElementTreeRoot) {
|
||||
@ -2392,7 +2391,6 @@ void Clay__CalculateFinalLayout(void) {
|
||||
Clay__WrappedTextLineArray_Add(&Clay__wrappedTextLines, CLAY__INIT(Clay__WrappedTextLine) { { measuredWord->width, lineHeight }, { .length = measuredWord->length, .chars = &textElementData->text.chars[measuredWord->startOffset] } });
|
||||
textElementData->wrappedLines.length++;
|
||||
wordIndex = measuredWord->next;
|
||||
lineStartOffset = measuredWord->startOffset + measuredWord->length;
|
||||
}
|
||||
// measuredWord->length == 0 means a newline character
|
||||
else if (measuredWord->length == 0 || lineWidth + measuredWord->width > containerElement->dimensions.width) {
|
||||
|
@ -426,8 +426,7 @@
|
||||
element.style.height = Math.round(renderCommand.boundingBox.height.value) + 'px';
|
||||
}
|
||||
|
||||
// note: commandType is packed to uint8_t and has 3 garbage bytes of padding
|
||||
switch(renderCommand.commandType.value & 0xff) {
|
||||
switch(renderCommand.commandType.value) {
|
||||
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
||||
break;
|
||||
}
|
||||
@ -581,9 +580,7 @@
|
||||
for (let i = 0; i < length; i++, arrayOffset += renderCommandSize) {
|
||||
let renderCommand = readStructAtAddress(arrayOffset, renderCommandDefinition);
|
||||
let boundingBox = renderCommand.boundingBox;
|
||||
|
||||
// note: commandType is packed to uint8_t and has 3 garbage bytes of padding
|
||||
switch(renderCommand.commandType.value & 0xff) {
|
||||
switch(renderCommand.commandType.value) {
|
||||
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
||||
break;
|
||||
}
|
||||
|
@ -317,9 +317,7 @@
|
||||
for (let i = 0; i < length; i++, arrayOffset += renderCommandSize) {
|
||||
let renderCommand = readStructAtAddress(arrayOffset, renderCommandDefinition);
|
||||
let boundingBox = renderCommand.boundingBox;
|
||||
|
||||
// note: commandType is packed to uint8_t and has 3 garbage bytes of padding
|
||||
switch(renderCommand.commandType.value & 0xff) {
|
||||
switch(renderCommand.commandType.value) {
|
||||
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
||||
break;
|
||||
}
|
||||
|
@ -336,7 +336,7 @@
|
||||
let element = null;
|
||||
if (!elementCache[renderCommand.id.value]) {
|
||||
let elementType = 'div';
|
||||
switch (renderCommand.commandType.value & 0xff) {
|
||||
switch (renderCommand.commandType.value) {
|
||||
case CLAY_RENDER_COMMAND_TYPE_RECTANGLE: {
|
||||
if (readStructAtAddress(renderCommand.config.value, rectangleConfigDefinition).link.length.value > 0) {
|
||||
elementType = 'a';
|
||||
@ -384,8 +384,7 @@
|
||||
element.style.height = Math.round(renderCommand.boundingBox.height.value) + 'px';
|
||||
}
|
||||
|
||||
// note: commandType is packed to uint8_t and has 3 garbage bytes of padding
|
||||
switch(renderCommand.commandType.value & 0xff) {
|
||||
switch(renderCommand.commandType.value) {
|
||||
case (CLAY_RENDER_COMMAND_TYPE_NONE): {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user