changeset 979:c1f3cc23b51b

subcomposer wouldn't draw right if there is an odd number of channels Ignore-this: 981a0c4ef92f82f2b14505185fb9fce6
author drewp@bigasterisk.com
date Sat, 15 Jun 2013 23:05:43 +0000
parents ce159eea90b5
children ca3ada5ee9cd
files light9/dmxchanedit.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light9/dmxchanedit.py	Sat Jun 15 23:05:35 2013 +0000
+++ b/light9/dmxchanedit.py	Sat Jun 15 23:05:43 2013 +0000
@@ -19,6 +19,7 @@
 from __future__ import nested_scopes,division
 import Tkinter as tk
 from rdflib import RDF, Literal
+import math
 from decimal import Decimal
 from light9.namespaces import L9
 
@@ -162,7 +163,7 @@
         chans = list(self.graph.subjects(RDF.type, L9.Channel))
         chans.sort(key=lambda c: int(self.graph.value(c, L9.output).rsplit('/c')[-1]))
         cols = 2
-        rows = len(chans) // cols
+        rows = int(math.ceil(len(chans) / cols))
 
         def make_frame(parent):
              f = tk.Frame(parent, bd=0, bg='black')