From 6a700c0863d3f3438868884830ea879dcd2fb98f Mon Sep 17 00:00:00 2001 From: jacob Date: Fri, 2 Jan 2026 18:19:50 -0600 Subject: [PATCH] clamp ui rect fwidth --- src/ui/ui_core.c | 2 +- src/ui/ui_shaders.g | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index fd69fc67..a7539b9c 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1129,7 +1129,7 @@ void UI_EndFrame(UI_Frame *frame) box->solved_scale = MulVec2Vec2(parent->solved_scale, box->solved_scale); } - f32 scale_snap = TweakFloat("UI scale snap threshold", 0.0050, 0, 0.01, .precision = 6); + f32 scale_snap = TweakFloat("UI scale snap threshold", 0.0010, 0, 0.01, .precision = 6); if (AbsF32(1.0 - box->solved_scale.x) < scale_snap) { box->solved_scale.x = 1; diff --git a/src/ui/ui_shaders.g b/src/ui/ui_shaders.g index 45c0cb88..d3b4ab4e 100644 --- a/src/ui/ui_shaders.g +++ b/src/ui/ui_shaders.g @@ -63,7 +63,7 @@ PixelShader(UI_DRectPS, UI_DRectPSOutput, UI_DRectPSInput input) if (p.x < bl.x && p.y > bl.y) { rect_dist = min(rect_dist, bl_radius - length(bl - p)); } } rect_dist = -rect_dist; - f32 rect_dist_fwidth = fwidth(rect_dist); + f32 rect_dist_fwidth = saturate(fwidth(rect_dist)); bool is_inside = rect_dist < 0;