forked from AuroraMiddleware/gtk
gl renderer: Don't invert offset value twice
This commit is contained in:
parent
d0d2ad9f5b
commit
f79c807645
@ -1555,7 +1555,7 @@ render_unblurred_inset_shadow_node (GskGLRenderer *self,
|
||||
op->outline = transform_rect (self, builder, gsk_inset_shadow_node_peek_outline (node));
|
||||
op->spread = spread * scale;
|
||||
op->offset[0] = dx * scale;
|
||||
op->offset[1] = -dy * scale;
|
||||
op->offset[1] = dy * scale;
|
||||
|
||||
load_vertex_data (vertex_data, node, builder);
|
||||
|
||||
@ -1737,7 +1737,7 @@ render_unblurred_outset_shadow_node (GskGLRenderer *self,
|
||||
op->outline = transform_rect (self, builder, outline);
|
||||
op->spread = spread * scale;
|
||||
op->offset[0] = dx * scale;
|
||||
op->offset[1] = - dy * scale;
|
||||
op->offset[1] = dy * scale;
|
||||
|
||||
load_vertex_data (vertex_data, node, builder);
|
||||
ops_draw (builder, vertex_data);
|
||||
|
@ -17,10 +17,9 @@ void main() {
|
||||
|
||||
RoundedRect outside = create_rect(u_outline_rect);
|
||||
RoundedRect inside = rounded_rect_shrink(outside, 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 (outside, f.xy) -
|
||||
rounded_rect_coverage (inside, f.xy - offset),
|
||||
rounded_rect_coverage (inside, f.xy - u_offset),
|
||||
0.0, 1.0);
|
||||
setOutputColor(color * u_alpha);
|
||||
}
|
||||
|
@ -19,9 +19,8 @@ void main() {
|
||||
RoundedRect inside = create_rect(u_outline_rect);
|
||||
RoundedRect outside = rounded_rect_shrink(inside, 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 (outside, f.xy - offset) -
|
||||
color = color * clamp (rounded_rect_coverage (outside, f.xy - u_offset) -
|
||||
rounded_rect_coverage (inside, f.xy),
|
||||
0.0, 1.0);
|
||||
setOutputColor(color * u_alpha);
|
||||
|
Loading…
Reference in New Issue
Block a user