clamp ui rect fwidth

This commit is contained in:
jacob 2026-01-02 18:19:50 -06:00
parent ba8b1667db
commit 6a700c0863
2 changed files with 2 additions and 2 deletions

View File

@ -1129,7 +1129,7 @@ void UI_EndFrame(UI_Frame *frame)
box->solved_scale = MulVec2Vec2(parent->solved_scale, box->solved_scale); 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) if (AbsF32(1.0 - box->solved_scale.x) < scale_snap)
{ {
box->solved_scale.x = 1; box->solved_scale.x = 1;

View File

@ -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)); } if (p.x < bl.x && p.y > bl.y) { rect_dist = min(rect_dist, bl_radius - length(bl - p)); }
} }
rect_dist = -rect_dist; 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; bool is_inside = rect_dist < 0;