Fix: Prevent clipping of node drop shadow

Fix clipping artifacts of node drop shadows that could occur
on hidden nodes, when using higher UI scaling.

Reviewed By: Hans Goudey

Differential Revision: http://developer.blender.org/D16007
This commit is contained in:
2022-09-18 20:39:14 +02:00
parent 998ffcbf09
commit 53c92efd5a

View File

@@ -2307,9 +2307,6 @@ void UI_draw_box_shadow(const rctf *rect, uchar alpha)
void ui_draw_dropshadow(
const rctf *rct, float radius, float aspect, float alpha, int UNUSED(select))
{
const float max_radius = (BLI_rctf_size_y(rct) - 10.0f) * 0.5f;
const float rad = min_ff(radius, max_radius);
/* This undoes the scale of the view for higher zoom factors to clamp the shadow size. */
const float clamped_aspect = smoothminf(aspect, 1.0f, 0.5f);
@@ -2317,6 +2314,9 @@ void ui_draw_dropshadow(
const float shadow_offset = 0.5f * U.widget_unit * clamped_aspect;
const float shadow_alpha = 0.5f * alpha;
const float max_radius = (BLI_rctf_size_y(rct) - shadow_offset) * 0.5f;
const float rad = min_ff(radius, max_radius);
GPU_blend(GPU_BLEND_ALPHA);
uiWidgetBaseParameters widget_params = {