overlays: Fix SDF rendering when scrolling is involved

This commit is contained in:
kd-11 2026-03-22 17:25:31 +03:00 committed by kd-11
parent 35907bcfc8
commit 04f7dd02fd

View File

@ -293,6 +293,12 @@ namespace rsx
{
v += vertex(x_offset, y_offset, 0.f, 0.f);
}
if (draw_commands[n].config.sdf_config.func != sdf_function::none)
{
draw_commands[n].config.sdf_config.cx += x_offset;
draw_commands[n].config.sdf_config.cy += y_offset;
}
}
}
@ -309,6 +315,12 @@ namespace rsx
v += vertex(x_offset, y_offset, 0.f, 0.f);
}
if (draw_commands[n].config.sdf_config.func != sdf_function::none)
{
draw_commands[n].config.sdf_config.cx += x_offset;
draw_commands[n].config.sdf_config.cy += y_offset;
}
draw_commands[n].config.clip_rect = clip_rect;
draw_commands[n].config.clip_region = true;
}
@ -621,14 +633,14 @@ namespace rsx
void overlay_element::configure_sdf(compiled_resource::command_config& config, sdf_function func)
{
const f32 rx = padding_left + static_cast<f32>(x);
const f32 rx = static_cast<f32>(x) + padding_left;
const f32 rw = static_cast<f32>(w) - (padding_left + padding_right);
const f32 ry = padding_top + static_cast<f32>(y);
const f32 ry = static_cast<f32>(y) + padding_top;
const f32 rh = static_cast<f32>(h) - (padding_top + padding_bottom);
config.sdf_config.func = func;
config.sdf_config.cx = margin_left + rx + (rw / 2.f);
config.sdf_config.cy = margin_top + ry + (rh / 2.f);
config.sdf_config.cx = rx + (rw / 2.f);
config.sdf_config.cy = ry + (rh / 2.f);
config.sdf_config.hx = rw / 2.f;
config.sdf_config.hy = rh / 2.f;
config.sdf_config.br = 0.f;