[Bf-blender-cvs] [53c92efd5a5] master: Fix: Prevent clipping of node drop shadow

Leon Schittek noreply at git.blender.org
Sun Sep 18 20:39:53 CEST 2022


Commit: 53c92efd5a524ae6fd9172cdb23b5e787456f498
Author: Leon Schittek
Date:   Sun Sep 18 20:39:14 2022 +0200
Branches: master
https://developer.blender.org/rB53c92efd5a524ae6fd9172cdb23b5e787456f498

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

===================================================================

M	source/blender/editors/interface/interface_draw.c

===================================================================

diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 190830568e3..f1a324c411a 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -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 = {



More information about the Bf-blender-cvs mailing list