[oe-commits] Peter Kjellerstedt : pybootchartgui: Make the horizontal scaling stay within bounds

git at git.openembedded.org git at git.openembedded.org
Mon Nov 18 12:44:53 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 50c2c3435915ef1ecbde395c71c5c9581c83fb2e
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=50c2c3435915ef1ecbde395c71c5c9581c83fb2e

Author: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
Date:   Fri Nov 15 18:08:51 2013 +0100

pybootchartgui: Make the horizontal scaling stay within bounds

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/pybootchartgui/pybootchartgui/gui.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/pybootchartgui/pybootchartgui/gui.py b/scripts/pybootchartgui/pybootchartgui/gui.py
index ddeb88c..164bdfb 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)



More information about the Openembedded-commits mailing list