[Avida-SVN] r2616 - branches/developers/avida-edward/source/python/AvidaGui2

kaben at myxo.css.msu.edu kaben at myxo.css.msu.edu
Sun Jun 8 16:54:45 PDT 2008


Author: kaben
Date: 2008-06-08 19:54:45 -0400 (Sun, 08 Jun 2008)
New Revision: 2616

Modified:
   branches/developers/avida-edward/source/python/AvidaGui2/pyGradientScaleView.py
Log:

In the color scale of the petri dish map legend, switched from three to four tick marks.



Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyGradientScaleView.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyGradientScaleView.py	2008-06-08 23:23:43 UTC (rev 2615)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyGradientScaleView.py	2008-06-08 23:54:45 UTC (rev 2616)
@@ -132,20 +132,44 @@
     )
 
 # draw the number label for the midpoint
+    #p.drawText(
+    #  #w - self.s_right_margin - label_width,
+#   #   w/2 - self.s_right_margin - self.s_label_text_width,
+    #  w/2 - self.s_label_text_width/2,
+    #  self.s_top_margin,
+    #  self.s_label_text_width,
+    #  self.s_text_height,
+    #  #label_width,
+    #  #text_height,
+    #  Qt.AlignBottom | Qt.AlignCenter,
+    #  self.getLabelString((self.m_max_value-self.m_min_value)/2.0)
+    #)
+
+    drawable_width = w - self.s_left_margin - self.s_right_margin
+    leftish = self.s_left_margin + drawable_width/3 - self.s_label_text_width/2
+    rightish = self.s_left_margin + (2 * drawable_width/3) - self.s_label_text_width/2
+
     p.drawText(
-      #w - self.s_right_margin - label_width,
-#      w/2 - self.s_right_margin - self.s_label_text_width,
-      w/2 - self.s_label_text_width/2,
+      #w/2 - self.s_label_text_width/2,
+      leftish,
       self.s_top_margin,
       self.s_label_text_width,
       self.s_text_height,
-      #label_width,
-      #text_height,
       Qt.AlignBottom | Qt.AlignCenter,
-      self.getLabelString((self.m_max_value-self.m_min_value)/2.0)
+      self.getLabelString((self.m_max_value-self.m_min_value)/3.0)
     )
 
+    p.drawText(
+      #w/2 - self.s_label_text_width/2,
+      rightish,
+      self.s_top_margin,
+      self.s_label_text_width,
+      self.s_text_height,
+      Qt.AlignBottom | Qt.AlignCenter,
+      self.getLabelString(2.0 * (self.m_max_value-self.m_min_value)/3.0)
+    )
 
+
 #  make a word label for the scale 
     p.drawText(
       w/2 - self.s_map_mode_name_label_width/2,




More information about the Avida-cvs mailing list