mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
Prevent unbalanced SCISSOR_END commands for culled containers
This commit is contained in:
parent
7d099ad870
commit
02abf00b01
1 changed files with 8 additions and 4 deletions
12
clay.h
12
clay.h
|
|
@ -3076,10 +3076,14 @@ void Clay__CalculateFinalLayout(void) {
|
|||
}
|
||||
// This exists because the scissor needs to end _after_ borders between elements
|
||||
if (closeClipElement) {
|
||||
Clay__AddRenderCommand(CLAY__INIT(Clay_RenderCommand) {
|
||||
.id = Clay__HashNumber(currentElement->id, rootElement->childrenOrTextContent.children.length + 11).id,
|
||||
.commandType = CLAY_RENDER_COMMAND_TYPE_SCISSOR_END,
|
||||
});
|
||||
Clay_LayoutElementHashMapItem *currentElementData = Clay__GetHashMapItem(currentElement->id);
|
||||
Clay_BoundingBox currentElementBoundingBox = currentElementData->boundingBox;
|
||||
if (!Clay__ElementIsOffscreen(¤tElementBoundingBox)) {
|
||||
Clay__AddRenderCommand(CLAY__INIT(Clay_RenderCommand) {
|
||||
.id = Clay__HashNumber(currentElement->id, rootElement->childrenOrTextContent.children.length + 11).id,
|
||||
.commandType = CLAY_RENDER_COMMAND_TYPE_SCISSOR_END,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
dfsBuffer.length--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue