Compare commits

..

1 Commits

Author SHA1 Message Date
Stowy
1a9a65a8ae
Merge be99977da6 into 02bce89d17 2025-03-04 11:29:42 +01:00
3 changed files with 5 additions and 8 deletions

View File

@ -89,7 +89,7 @@ int main() {
CLAY({ CLAY({
.id = CLAY_ID("SideBar"), .id = CLAY_ID("SideBar"),
.layout = { .layoutDirection = CLAY_TOP_TO_BOTTOM, .sizing = { .width = CLAY_SIZING_FIXED(300), .height = CLAY_SIZING_GROW(0) }, .padding = CLAY_PADDING_ALL(16), .childGap = 16 }, .layout = { .layoutDirection = CLAY_TOP_TO_BOTTOM, .sizing = { .width = CLAY_SIZING_FIXED(300), .height = CLAY_SIZING_GROW(0) }, .padding = CLAY_PADDING_ALL(16), .childGap = 16 },
.backgroundColor = COLOR_LIGHT .backgroundColor = COLOR_LIGHT }
}) { }) {
CLAY({ .id = CLAY_ID("ProfilePictureOuter"), .layout = { .sizing = { .width = CLAY_SIZING_GROW(0) }, .padding = CLAY_PADDING_ALL(16), .childGap = 16, .childAlignment = { .y = CLAY_ALIGN_Y_CENTER } }, .backgroundColor = COLOR_RED }) { CLAY({ .id = CLAY_ID("ProfilePictureOuter"), .layout = { .sizing = { .width = CLAY_SIZING_GROW(0) }, .padding = CLAY_PADDING_ALL(16), .childGap = 16, .childAlignment = { .y = CLAY_ALIGN_Y_CENTER } }, .backgroundColor = COLOR_RED }) {
CLAY({ .id = CLAY_ID("ProfilePicture"), .layout = { .sizing = { .width = CLAY_SIZING_FIXED(60), .height = CLAY_SIZING_FIXED(60) }}, .image = { .imageData = &profilePicture, .sourceDimensions = {60, 60} } }) {} CLAY({ .id = CLAY_ID("ProfilePicture"), .layout = { .sizing = { .width = CLAY_SIZING_FIXED(60), .height = CLAY_SIZING_FIXED(60) }}, .image = { .imageData = &profilePicture, .sourceDimensions = {60, 60} } }) {}

View File

@ -36,7 +36,7 @@ Dimensions :: struct {
Arena :: struct { Arena :: struct {
nextAllocation: uintptr, nextAllocation: uintptr,
capacity: c.size_t, capacity: uintptr,
memory: [^]c.char, memory: [^]c.char,
} }
@ -367,7 +367,7 @@ Context :: struct {} // opaque structure, only use as a pointer
@(link_prefix = "Clay_", default_calling_convention = "c") @(link_prefix = "Clay_", default_calling_convention = "c")
foreign Clay { foreign Clay {
MinMemorySize :: proc() -> u32 --- MinMemorySize :: proc() -> u32 ---
CreateArenaWithCapacityAndMemory :: proc(capacity: c.size_t, offset: [^]u8) -> Arena --- CreateArenaWithCapacityAndMemory :: proc(capacity: u32, offset: [^]u8) -> Arena ---
SetPointerState :: proc(position: Vector2, pointerDown: bool) --- SetPointerState :: proc(position: Vector2, pointerDown: bool) ---
Initialize :: proc(arena: Arena, layoutDimensions: Dimensions, errorHandler: ErrorHandler) -> ^Context --- Initialize :: proc(arena: Arena, layoutDimensions: Dimensions, errorHandler: ErrorHandler) -> ^Context ---
GetCurrentContext :: proc() -> ^Context --- GetCurrentContext :: proc() -> ^Context ---

View File

@ -91,11 +91,8 @@ static inline Clay_Dimensions Raylib_MeasureText(Clay_StringSlice text, Clay_Tex
float textHeight = config->fontSize; float textHeight = config->fontSize;
Font* fonts = (Font*)userData; Font* fonts = (Font*)userData;
Font fontToUse = fonts[config->fontId]; Font fontToUse = fonts[config->fontId];
// Font failed to load, likely the fonts are in the wrong place relative to the execution dir. // Font failed to load, likely the fonts are in the wrong place relative to the execution dir
// RayLib ships with a default font, so we can continue with that built in one. if (!fontToUse.glyphs) return textSize;
if (!fontToUse.glyphs) {
fontToUse = GetFontDefault();
}
float scaleFactor = config->fontSize/(float)fontToUse.baseSize; float scaleFactor = config->fontSize/(float)fontToUse.baseSize;