changeset 380:a13f2caf6f25

fix SC dragging after you load a sub
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 15 Jun 2007 21:51:51 +0000
parents 546e01adad37
children fb7bb50c3ced
files bin/subcomposer light9/uihelpers.py
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bin/subcomposer	Fri Jun 15 21:23:53 2007 +0000
+++ b/bin/subcomposer	Fri Jun 15 21:51:51 2007 +0000
@@ -86,7 +86,7 @@
     def loadsub(self, subname):
         """puts a sub into the levels, replacing old level values"""
         s=Submaster.Submasters().get_sub_by_name(subname)
-        self.levels[:]=s.get_dmx_list()
+        self.set_levels(s.get_dmx_list())
         dispatcher.send("levelchanged")
     def sendupdate(self):
         if not self.dmxdummy:
@@ -100,7 +100,8 @@
         if use_after_loop:
             self.after(use_after_loop, self.considersendupdate, use_after_loop)
     def set_levels(self, levels):
-        self.levels[:] = levels
+        oldLen = len(self.levels)
+        self.levels[:] = levels + [0] * (oldLen - len(levels))
         dispatcher.send("levelchanged")
 
 class EntryCommand(tk.Frame):
--- a/light9/uihelpers.py	Fri Jun 15 21:23:53 2007 +0000
+++ b/light9/uihelpers.py	Fri Jun 15 21:51:51 2007 +0000
@@ -57,8 +57,8 @@
 
 def positionOnCurrentDesktop(xform, screenWidth=1920, screenHeight=1440):
     size, x, y = xform.split('+')
-    x = int(x) % 1920
-    y = int(y) % 1440
+    x = int(x) % screenWidth
+    y = int(y) % screenHeight
     return "%s+%s+%s" % (size, x, y)