diff Dock.lua @ 73:3745540e8996 v2.1.74

- New commands: - /dvn remove (index|tag) will remove a channel from the current profile - /dvncolors resets the tag color cache - Fixed an issue with creating more than one output channel per UI session. - Performance improvements: - Color caching now ignores decimal timestamps, removing a source of cache bloat - Cleaned up a bunch of global variable use in many areas
author Nenue
date Sat, 09 Apr 2016 06:34:04 -0400
parents 516ceb31703d
children f6fae1a4c66c
line wrap: on
line diff
--- a/Dock.lua	Sat Apr 09 05:51:19 2016 -0400
+++ b/Dock.lua	Sat Apr 09 06:34:04 2016 -0400
@@ -47,10 +47,17 @@
 function D:UpdateDock()
   local pad_offset = 12
   local draw_offset = pad_offset
-  for i = 1, #self.dock.buttons do
+
+  local dockn = 1
+  for i, d in pairs(self.dock.buttons) do
+    dockn = max(i, dockn)
+  end
+  for i = 1, dockn do
     local d = self.dock.buttons[i]
-    d:SetPoint('TOPLEFT',  DevianDock, 'TOPLEFT', draw_offset, 0)
-    draw_offset=  draw_offset + d:GetWidth() + pad_offset
+    if d then
+      d:SetPoint('TOPLEFT',  DevianDock, 'TOPLEFT', draw_offset, 0)
+      draw_offset=  draw_offset + d:GetWidth() + pad_offset
+    end
   end
   self.dock:SetWidth(draw_offset)
 end