Switch CLAY_CLIP_TO_NONE to default option for floating elements

This commit is contained in:
Nic Barker 2025-05-14 13:18:01 +12:00
parent 78e83b15e0
commit 9ab240376f

14
clay.h
View file

@ -445,12 +445,12 @@ typedef CLAY_PACKED_ENUM {
CLAY_ATTACH_TO_ROOT, CLAY_ATTACH_TO_ROOT,
} Clay_FloatingAttachToElement; } Clay_FloatingAttachToElement;
// Controls how a floating element is clipped // Controls whether or not a floating element is clipped to the same clipping rectangle as the element it's attached to.
typedef CLAY_PACKED_ENUM { typedef CLAY_PACKED_ENUM {
// (default) The floating element is clipped by the context of its attached parent. // (default) - The floating element does not inherit clipping.
CLAY_CLIP_TO_ATTACHED_PARENT,
// The floating element is not clipped.
CLAY_CLIP_TO_NONE, CLAY_CLIP_TO_NONE,
// The floating element is clipped to the same clipping rectangle as the element it's attached to.
CLAY_CLIP_TO_ATTACHED_PARENT
} Clay_FloatingClipToElement; } Clay_FloatingClipToElement;
// Controls various settings related to "floating" elements, which are elements that "float" above other elements, potentially overlapping their boundaries, // Controls various settings related to "floating" elements, which are elements that "float" above other elements, potentially overlapping their boundaries,
@ -481,9 +481,9 @@ typedef struct {
// CLAY_ATTACH_TO_ELEMENT_WITH_ID - Attaches this floating element to an element with a specific ID, specified with the .parentId field. positioned based on the .attachPoints and .offset fields. // CLAY_ATTACH_TO_ELEMENT_WITH_ID - Attaches this floating element to an element with a specific ID, specified with the .parentId field. positioned based on the .attachPoints and .offset fields.
// CLAY_ATTACH_TO_ROOT - Attaches this floating element to the root of the layout, which combined with the .offset field provides functionality similar to "absolute positioning". // CLAY_ATTACH_TO_ROOT - Attaches this floating element to the root of the layout, which combined with the .offset field provides functionality similar to "absolute positioning".
Clay_FloatingAttachToElement attachTo; Clay_FloatingAttachToElement attachTo;
// Controls how a floating element is clipped // Controls whether or not a floating element is clipped to the same clipping rectangle as the element it's attached to.
// CLAY_CLIP_TO_ATTACHED_PARENT (default) - The floating element is clipped by the context of its attached parent. // CLAY_CLIP_TO_NONE (default) - The floating element does not inherit clipping.
// CLAY_CLIP_TO_NONE - The floating element is not clipped. // CLAY_CLIP_TO_ATTACHED_PARENT - The floating element is clipped to the same clipping rectangle as the element it's attached to.
Clay_FloatingClipToElement clipTo; Clay_FloatingClipToElement clipTo;
} Clay_FloatingElementConfig; } Clay_FloatingElementConfig;