spring: Make clip behavior configurable
When the spring goes outside the envelope, we have a few options for
bringing it back: either just let it overshoot, bounce off the limit or
just clamp it. Instead of controlling that with #ifdef, let's make it
a part of the spring state.
diff --git a/src/compositor.h b/src/compositor.h
index a56bd4d..12ec8e3 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -113,6 +113,12 @@
struct wl_list link;
};
+enum {
+ WESTON_SPRING_OVERSHOOT,
+ WESTON_SPRING_CLAMP,
+ WESTON_SPRING_BOUNCE
+};
+
struct weston_spring {
double k;
double friction;
@@ -120,6 +126,7 @@
double target;
double previous;
uint32_t timestamp;
+ uint32_t clip;
};
enum {