[gnome-shell] scroll-view-fade: Tweak easing at edges
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] scroll-view-fade: Tweak easing at edges
- Date: Fri, 1 Mar 2013 16:30:23 +0000 (UTC)
commit b394d184cc7fa68924da7e4c57ba9d2eb84c97ef
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Feb 23 01:37:05 2013 +0100
scroll-view-fade: Tweak easing at edges
Since commit b4f5f1e46174, the effect is eased in at the scroll
view's edges so that it does not appear out of nowhere. However,
the linear easing used is not the best option, as now the effect
appears so late that content near the edges ends up just being
cut off rather than faded out.
So adjust the easing function to have the effect appear faster.
https://bugzilla.gnome.org/show_bug.cgi?id=694327
src/st/st-scroll-view-fade.glsl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/st/st-scroll-view-fade.glsl b/src/st/st-scroll-view-fade.glsl
index 6acd260..e8bd03a 100644
--- a/src/st/st-scroll-view-fade.glsl
+++ b/src/st/st-scroll-view-fade.glsl
@@ -64,20 +64,20 @@ void main ()
float vfade_scale = height / vfade_offset;
if (fade_top) {
- ratio *= FADE((y / vfade_offset), min(vvalue * vfade_scale, 1.0));
+ ratio *= FADE((y / vfade_offset), min(sqrt(vvalue) * vfade_scale, 1.0));
}
if (fade_bottom) {
- ratio *= FADE((fade_area[1][1] - y)/(fade_area[1][1] - fade_bottom_start), min((1.0 - vvalue) *
vfade_scale, 1.0));
+ ratio *= FADE((fade_area[1][1] - y)/(fade_area[1][1] - fade_bottom_start), min(sqrt(1.0 - vvalue) *
vfade_scale, 1.0));
}
float hfade_scale = width / hfade_offset;
if (fade_left) {
- ratio *= FADE(x / hfade_offset, min(hvalue * hfade_scale, 1.0));
+ ratio *= FADE(x / hfade_offset, min(sqrt(hvalue) * hfade_scale, 1.0));
}
if (fade_right) {
- ratio *= FADE((fade_area[1][0] - x)/(fade_area[1][0] - fade_right_start), min((1.0 - hvalue) *
hfade_scale, 1.0));
+ ratio *= FADE((fade_area[1][0] - x)/(fade_area[1][0] - fade_right_start), min(sqrt(1.0 - hvalue) *
hfade_scale, 1.0));
}
cogl_color_out *= ratio;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]