[gtk+/wip/baedert/gl: 47/86] gl renderer: Fix inset shadow offset calculation



commit cc1d98b977996aa85e1d010b622cd53cf19de77f
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]