Author: eallen Date: 2010-12-14 19:45:52 +0000 (Tue, 14 Dec 2010) New Revision: 4435
Modified: trunk/cumin/python/cumin/charts.py trunk/cumin/resources/slotvis.js Log: Finishing up BZ 625213: - For png slot vis, add some padding and make lines thicker when zoomed in - Change Owner to Unavailable
Modified: trunk/cumin/python/cumin/charts.py =================================================================== --- trunk/cumin/python/cumin/charts.py 2010-12-14 15:14:55 UTC (rev 4434) +++ trunk/cumin/python/cumin/charts.py 2010-12-14 19:45:52 UTC (rev 4435) @@ -19,11 +19,8 @@ self.cols = 0 # columns self.rows = 0 self.max_size = 28 # size of each slot - self.min_size = 2 - self.min_sphere_size = 8 # use boxes if below this size - self.min_font = 10 - self.min_shadow = 14 self.surface = None + self.gap = 3
def plot_colored_rect(self, interior, width, height): surface = ImageSurface(FORMAT_ARGB32, int(width), int(height)) @@ -46,21 +43,21 @@ def _plot_square(self, cr, colors, state, x, y, width, height): cr.set_source_rgb(*colors) #cr.move_to(x, y) - cr.rectangle(x, y, width - 1, height - 1) + cr.rectangle(x, y, width - self.gap, height - self.gap)
if state == "Unclaimed": # leave empty cr.stroke() elif state == "Claimed": # solid fill cr.fill() - elif state == "Owner": # diagonal line + elif state in ("Owner", "Unavailable"): # diagonal line cr.move_to(x, y) - cr.line_to(x + width - 1, y + height - 1) + cr.line_to(x + width - self.gap, y + height - self.gap) cr.stroke() elif state in ("Matched", "Preempting", "Preempting/Matched"): # triangle cr.stroke() - cr.move_to(x + width - 1, y) - cr.line_to(x, y + height - 1) - cr.line_to(x + width - 1, y + height - 1) + cr.move_to(x + width - self.gap, y) + cr.line_to(x, y + height - self.gap) + cr.line_to(x + width - self.gap, y + height - self.gap) cr.close_path() cr.fill()
@@ -74,8 +71,9 @@ # the width and height depend on the number of slots self.surface = ImageSurface(FORMAT_ARGB32, int(self.width), int(self.height)) cr = Context(self.surface) - cr.set_line_width(1)
+ cr.set_line_width( zl == 1 and 1 or 2 ) + for slot in slots: interior, state = slot[:2]
@@ -102,16 +100,8 @@ if size > self.max_size * zoom: size = self.max_size * zoom
- #if size * cols < self.width: - # if size < self.max_size: - # size = size + 1 - self.width = int((size * cols) + 1) - #if self.width < self.max_width: - # self.width = self.max_width self.height = int((ceil(count * 1.0 / cols) * size) + 1) - #if self.height < self.max_height: - # self.height = self.max_height self.cols = cols return size
Modified: trunk/cumin/resources/slotvis.js =================================================================== --- trunk/cumin/resources/slotvis.js 2010-12-14 15:14:55 UTC (rev 4434) +++ trunk/cumin/resources/slotvis.js 2010-12-14 19:45:52 UTC (rev 4435) @@ -524,11 +524,11 @@ slot_hover_timer = null; } var width = slot_map_info.size; - if (width == 0) return; + if (width <= 0) return; var rx = col * width + slot_clip_left; var ry = row * width + slot_clip_top; - oHover.style.width = (width-2) + "px"; - oHover.style.height = (width-2) + "px"; + oHover.style.width = (width-4) + "px"; + oHover.style.height = (width-4) + "px";
switch (leg) { case 0:
cumin-developers@lists.fedorahosted.org