[oe-commits] Peter Kjellerstedt : pybootchartgui: Draw a lot less ticks

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


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

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

pybootchartgui: Draw a lot less ticks

With this, one second ticks are only enabled if the width of a second is
five pixels or more. It is also possible to distinguish 1, 5 and 30
second ticks.

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

---

 scripts/pybootchartgui/pybootchartgui/draw.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py
index 6b15d64..a22ac80 100644
--- a/scripts/pybootchartgui/pybootchartgui/draw.py
+++ b/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -203,6 +203,12 @@ def draw_box_ticks(ctx, rect, sec_w):
 	ctx.set_line_cap(cairo.LINE_CAP_SQUARE)
 
 	for i in range(sec_w, rect[2] + 1, sec_w):
+		if ((i / sec_w) % 10 == 0) :
+			ctx.set_line_width(1.5)
+		elif sec_w < 5 :
+			continue
+		else :
+			ctx.set_line_width(1.0)
 		if ((i / sec_w) % 30 == 0) :
 			ctx.set_source_rgba(*TICK_COLOR_BOLD)
 		else :
@@ -210,6 +216,7 @@ def draw_box_ticks(ctx, rect, sec_w):
 		ctx.move_to(rect[0] + i, rect[1] + 1)
 		ctx.line_to(rect[0] + i, rect[1] + rect[3] - 1)
 		ctx.stroke()
+	ctx.set_line_width(1.0)
 
 	ctx.set_line_cap(cairo.LINE_CAP_BUTT)
 



More information about the Openembedded-commits mailing list