From: Philipp Zabel Date: Mon, 1 Mar 2010 07:14:53 +0000 (+0100) Subject: Fix Ramp / Wait edit dialog initialisation for long step times X-Git-Tag: v0.0.3~9 X-Git-Url: http://vcs.maemo.org/git/?p=led-pattern-ed;a=commitdiff_plain;h=8c37112db00bbc06449d7f6328f8542f7e2b5d86 Fix Ramp / Wait edit dialog initialisation for long step times --- diff --git a/src/led-command-widget.vala b/src/led-command-widget.vala index 3e33bea..c4fb0df 100644 --- a/src/led-command-widget.vala +++ b/src/led-command-widget.vala @@ -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)