clamp ui rect fwidth
This commit is contained in:
parent
ba8b1667db
commit
6a700c0863
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user