changeset 17:94d9eccce1d7

prevent edge width breaking when new edges are added
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 02 Jan 2011 20:25:44 -0800
parents f50b4e4ad764
children 2aeac6508dc3
files svgsitemap/middleware.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/svgsitemap/middleware.py	Sun Jan 02 14:04:38 2011 -0800
+++ b/svgsitemap/middleware.py	Sun Jan 02 20:25:44 2011 -0800
@@ -168,11 +168,14 @@
             edge = self.graph.get_edge(from_url, to_url)
             self.label(edge, count)
         else:
+            count = 1
             self.edges[(from_url, to_url)] = 1
-            self.max = 1
             labeltooltip = '1: %s -> %s' % (from_url, to_url)
             self.graph.add_edge(from_url, to_url, label='', tooltip=labeltooltip, href='#')
 
+        if count > self.max:
+            self.max = count
+
         if self.maxwidth:
             self.set_widths()