# HG changeset patch # User drewp@bigasterisk.com # Date 1371337543 0 # Node ID c1f3cc23b51b48a0cd82ad91f36c7ba9b69125ad # Parent ce159eea90b5658dfba3ea40b98316730be319c6 subcomposer wouldn't draw right if there is an odd number of channels Ignore-this: 981a0c4ef92f82f2b14505185fb9fce6 diff -r ce159eea90b5 -r c1f3cc23b51b light9/dmxchanedit.py --- 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')