st/theme-node-drawing: Fix inner shadow fast path condition

We want to use the fast path of filling the entire area if either the
left and right shadows would overlap or the top and bottom shadows. The
latter check was wrong due to a typo resulting in the regular path
being used in some cases it couldn't (and shouldn't) handle.

This was causing the inset shadow used to highlight panel buttons to
not appear for buttons above a certain width.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1646>
This commit is contained in:
Sebastian Keller 2021-02-07 00:23:04 +01:00 committed by Marge Bot
parent 0a35735ba0
commit 9e86cdbe71

View File

@ -928,7 +928,7 @@ paint_inset_box_shadow_to_cairo_context (StThemeNode *node,
shrunk_extents_x2 = extents_x2 + shadow_spec->xoffset - shadow_spec->spread;
shrunk_extents_y2 = extents_y2 + shadow_spec->yoffset - shadow_spec->spread;
if (shrunk_extents_x1 >= shrunk_extents_x2 || shrunk_extents_y1 >= shrunk_extents_x2)
if (shrunk_extents_x1 >= shrunk_extents_x2 || shrunk_extents_y1 >= shrunk_extents_y2)
{
/* Shadow occupies entire area within border */
shadow_pattern = cairo_pattern_create_rgb (0., 0., 0.);