[PATCH weston] shell: Update surface_opacity_binding() to work with recent alpha value changes.
Scott Moreau
oreaus at gmail.com
Mon May 21 22:58:36 PDT 2012
---
src/shell.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/shell.c b/src/shell.c
index a4a98c7..f7b9527 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1598,7 +1598,7 @@ surface_opacity_binding(struct wl_seat *seat, uint32_t time,
uint32_t key, uint32_t button, uint32_t axis,
int32_t value, void *data)
{
- uint32_t step = 15;
+ float step = 0.05;
struct shell_surface *shsurf;
struct weston_surface *surface =
(struct weston_surface *) seat->pointer->focus;
@@ -1620,8 +1620,8 @@ surface_opacity_binding(struct wl_seat *seat, uint32_t time,
surface->alpha += value * step;
- if (surface->alpha > 255)
- surface->alpha = 255;
+ if (surface->alpha > 1.0)
+ surface->alpha = 1.0;
if (surface->alpha < step)
surface->alpha = step;
--
1.7.7.6
More information about the wayland-devel
mailing list