Fix Ramp / Wait edit dialog initialisation for long step times
authorPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 1 Mar 2010 07:14:53 +0000 (08:14 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 1 Mar 2010 07:14:53 +0000 (08:14 +0100)
src/led-command-widget.vala

index 3e33bea..c4fb0df 100644 (file)
@@ -107,9 +107,9 @@ class LedCommandWidget : Gtk.HBox {
                content.pack_start (lpv, true, true, 0);
 
                var scale1 = new Gtk.HScale.with_range (1, 62, 1);
-               int v = (int) (command.step_time / 16 / CYCLE_TIME_MS);
+               var v = (command.step_time / 16 / CYCLE_TIME_MS);
                if (v > 62)
-                       v /= 32;
+                       v = v / 32 + 31;
                scale1.set_value (v);
                scale1.format_value.connect ((v) => {
                        if (v < 32)