diff --git a/src/st/st-scroll-view-fade.c b/src/st/st-scroll-view-fade.c index 9f267c3b6..ded8efb2a 100644 --- a/src/st/st-scroll-view-fade.c +++ b/src/st/st-scroll-view-fade.c @@ -142,11 +142,13 @@ st_scroll_view_fade_paint_target (ClutterOffscreenEffect *effect) st_adjustment_get_values (self->vadjustment, &value, &lower, &upper, NULL, NULL, &page_size); value = (value - lower) / (upper - page_size - lower); - clutter_shader_effect_set_uniform (shader, "fade_edges_v", G_TYPE_INT, 1, self->fade_edges ? value >= 0.0 : value > 0.0); + clutter_shader_effect_set_uniform (shader, "fade_edges_top", G_TYPE_INT, 1, self->fade_edges ? value >= 0.0 : value > 0.0); + clutter_shader_effect_set_uniform (shader, "fade_edges_bottom", G_TYPE_INT, 1, self->fade_edges ? value <= 1.0 : value < 1.0); st_adjustment_get_values (self->hadjustment, &value, &lower, &upper, NULL, NULL, &page_size); value = (value - lower) / (upper - page_size - lower); - clutter_shader_effect_set_uniform (shader, "fade_edges_h", G_TYPE_INT, 1, self->fade_edges ? value >= 0.0 : value > 0.0); + clutter_shader_effect_set_uniform (shader, "fade_edges_left", G_TYPE_INT, 1, self->fade_edges ? value >= 0.0 : value > 0.0); + clutter_shader_effect_set_uniform (shader, "fade_edges_right", G_TYPE_INT, 1, self->fade_edges ? value <= 1.0 : value < 1.0); clutter_shader_effect_set_uniform (shader, "vfade_offset", G_TYPE_FLOAT, 1, self->vfade_offset); clutter_shader_effect_set_uniform (shader, "hfade_offset", G_TYPE_FLOAT, 1, self->hfade_offset); diff --git a/src/st/st-scroll-view-fade.glsl b/src/st/st-scroll-view-fade.glsl index 23881fb97..9180aa184 100644 --- a/src/st/st-scroll-view-fade.glsl +++ b/src/st/st-scroll-view-fade.glsl @@ -22,8 +22,10 @@ uniform float height; uniform float width; uniform float vfade_offset; uniform float hfade_offset; -uniform bool fade_edges_h; -uniform bool fade_edges_v; +uniform bool fade_edges_top; +uniform bool fade_edges_right; +uniform bool fade_edges_bottom; +uniform bool fade_edges_left; uniform vec2 fade_area_topleft; uniform vec2 fade_area_bottomright; @@ -44,10 +46,10 @@ void main () float ratio = 1.0; float fade_bottom_start = fade_area_bottomright[1] - vfade_offset; float fade_right_start = fade_area_bottomright[0] - hfade_offset; - bool fade_top = y < vfade_offset && fade_edges_v; - bool fade_bottom = y > fade_bottom_start && fade_edges_v; - bool fade_left = x < hfade_offset && fade_edges_h; - bool fade_right = x > fade_right_start && fade_edges_h; + bool fade_top = y < vfade_offset && fade_edges_top; + bool fade_bottom = y > fade_bottom_start && fade_edges_bottom; + bool fade_left = x < hfade_offset && fade_edges_left; + bool fade_right = x > fade_right_start && fade_edges_right; float vfade_scale = height / vfade_offset; if (fade_top) {