[snappy] ui: controls clamped to a minimum pixel size



commit 42e231ff44bcd63c3a0d77631aa6b7ee5e9faaaf
Author: Luis de Bethencourt <luis debethencourt com>
Date:   Wed Apr 17 11:58:36 2013 -0400

    ui: controls clamped to a minimum pixel size

 src/user_interface.c | 3 +++
 src/user_interface.h | 1 +
 2 files changed, 4 insertions(+)
---
diff --git a/src/user_interface.c b/src/user_interface.c
index 230e151..1d33850 100644
--- a/src/user_interface.c
+++ b/src/user_interface.c
@@ -1141,6 +1141,9 @@ update_controls_size (UserInterface * ui)
   if (ctl_width > CONTROLS_MAX_WIDTH) {
     ctl_width = CONTROLS_MAX_WIDTH;
     ctl_height = ctl_width / CONTROLS_ASPECT_RATIO;
+  } else if (ctl_width < CONTROLS_MIN_WIDTH) {
+    ctl_width = CONTROLS_MIN_WIDTH;
+    ctl_height = ctl_width / CONTROLS_ASPECT_RATIO;
   }
 
   icon_size = ctl_height * PLAY_TOGGLE_RATIO;
diff --git a/src/user_interface.h b/src/user_interface.h
index ad50639..509ea34 100644
--- a/src/user_interface.h
+++ b/src/user_interface.h
@@ -35,6 +35,7 @@
 #define CONTROLS_HEIGHT_RATIO 0.20f
 #define CONTROLS_ASPECT_RATIO 4.0f
 #define CONTROLS_MAX_WIDTH 480.0f
+#define CONTROLS_MIN_WIDTH 300.0f
 
 #define MAIN_BOX_W 0.95f
 #define MAIN_BOX_H 0.8f


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]