summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2013-11-15 18:08:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-18 12:40:54 +0000
commit50c2c3435915ef1ecbde395c71c5c9581c83fb2e (patch)
treeaf7365cde4d6e54f49b2e73ea89cbf2e3b1dadc5
parent6f1568e54a7808b2ab568618fc5bb244249579f1 (diff)
downloadopenembedded-core-contrib-50c2c3435915ef1ecbde395c71c5c9581c83fb2e.tar.gz
openembedded-core-contrib-50c2c3435915ef1ecbde395c71c5c9581c83fb2e.tar.bz2
openembedded-core-contrib-50c2c3435915ef1ecbde395c71c5c9581c83fb2e.zip
pybootchartgui: Make the horizontal scaling stay within bounds
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/pybootchartgui/pybootchartgui/gui.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/gui.py b/scripts/pybootchartgui/pybootchartgui/gui.py
index ddeb88cd9b..164bdfbd3a 100644
--- a/scripts/pybootchartgui/pybootchartgui/gui.py
+++ b/scripts/pybootchartgui/pybootchartgui/gui.py
@@ -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)