pybootchartgui: Make the horizontal scaling stay within bounds

(From OE-Core rev: 50c2c3435915ef1ecbde395c71c5c9581c83fb2e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Kjellerstedt 2013-11-15 18:08:51 +01:00 committed by Richard Purdie
parent d0e513d437
commit cacd502cd3
1 changed files with 2 additions and 2 deletions

View File

@ -101,10 +101,10 @@ class PyBootchartWidget(gtk.DrawingArea):
self.zoom_image (self.zoom_ratio)
def on_expand(self, action):
self.set_xscale (self.xscale * 1.5)
self.set_xscale (int(self.xscale * 1.5 + 0.5))
def on_contract(self, action):
self.set_xscale (self.xscale / 1.5)
self.set_xscale (max(int(self.xscale / 1.5), 1))
def on_zoom_in(self, action):
self.zoom_image(self.zoom_ratio * self.ZOOM_INCREMENT)