Skip to content
Browse files

fix cpm axis scale

  • Loading branch information...
1 parent 4b01186 commit 713623a459b51049c93289b3e66a98eb1b973e4f @baverman committed Feb 11, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 typetrainer/ui/stat.py
View
4 typetrainer/ui/stat.py
@@ -43,7 +43,7 @@ def draw(self, cr, width, height):
mincpm = min(self.data.values(), key=lambda r: r[0])[0]
maxcpm = max(self.data.values(), key=lambda r: r[0])[0]
- gap = maxcpm - mincpm
+ gap = max(maxcpm - mincpm, 34)
mincpm = int(max(mincpm - gap * 0.3, 0) / 10.0) * 10
maxcpm = int( (maxcpm + gap * 0.3) / 10.0 + 0.9 ) * 10
@@ -127,7 +127,7 @@ def draw_grid(self, cr, mindt, maxdt, mincpm, maxcpm, hfactor):
cr.set_source_rgb(0.0, 0.0, 0.0)
for y in range(mincpm, maxcpm, 10):
- self.draw_label(cr, str(y), mindt, y*hfactor+0.5, 1.5, 1.0, -1.2, -0.5)
+ self.draw_label(cr, str(y), mindt-1.5, y*hfactor+0.5, 1.5, 1.0, 0.8, -0.5)
def get_text_pos(self, cr, label, x, y, w, h, xalign, yalign):
fascent, fdescent, fheight, fxadvance, fyadvance = cr.font_extents()

0 comments on commit 713623a

Please sign in to comment.
Something went wrong with that request. Please try again.