only scale pixel sizes

This commit is contained in:
jacob 2025-12-29 03:10:13 -06:00
parent 211a6e641d
commit f7df2f78b8

View File

@ -1079,14 +1079,18 @@ void UI_EndFrame(UI_Frame *frame)
Assert(post_index == boxes_count); Assert(post_index == boxes_count);
} }
// Apply scales // Scale semantic pixel sizes
for (u64 pre_index = 0; pre_index < boxes_count; ++pre_index) for (u64 pre_index = 0; pre_index < boxes_count; ++pre_index)
{ {
UI_Box *box = boxes_pre[pre_index]; UI_Box *box = boxes_pre[pre_index];
for (Axis axis = 0; axis < Axis_COUNTXY; ++axis) for (Axis axis = 0; axis < Axis_COUNTXY; ++axis)
{ {
UI_Size *sem_dims = &box->desc.pref_semantic_dims[axis]; UI_Size *sem_dims = &box->desc.pref_semantic_dims[axis];
sem_dims->v *= box->desc.scale; b32 skip = sem_dims->kind != UI_SizeKind_Pixel;
if (!skip)
{
sem_dims->v *= box->desc.scale;
}
} }
} }