[gtk+/wip/baedert/gl: 167/216] gl renderer: Fix inset shadow offset calculation



commit 381471affe04439f75d8ca7a35e100c75e1570cf
Author: Timm Bäder <mail baedert org>
Date:   Fri Dec 1 08:32:00 2017 +0100

    gl renderer: Fix inset shadow offset calculation

 gsk/resources/glsl/inset_shadow.fs.glsl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gsk/resources/glsl/inset_shadow.fs.glsl b/gsk/resources/glsl/inset_shadow.fs.glsl
index 4337dac..b6bb87c 100644
--- a/gsk/resources/glsl/inset_shadow.fs.glsl
+++ b/gsk/resources/glsl/inset_shadow.fs.glsl
@@ -18,10 +18,10 @@ void main() {
   RoundedRect inside = rounded_rect_shrink(outline, vec4(u_spread));
 
 
-
+  vec2 offset = vec2(u_offset.x, - u_offset.y);
   vec4 color = vec4(u_color.rgb * u_color.a, u_color.a);
   color = color * clamp (rounded_rect_coverage (outline, f.xy) -
-                         rounded_rect_coverage (inside, f.xy + u_offset),
+                         rounded_rect_coverage (inside, f.xy - offset),
                          0.0, 1.0);
   setOutputColor(color);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]