diff mbox series

[4/4] pybootchartgui: fix width max usage in draw_label_in_box

Message ID 20230710222420.2235277-4-jose.quaresma@foundries.io
State Accepted, archived
Commit b1cea47c52899a85428e0bddf82ba6a07689673b
Headers show
Series [1/4] pybootchartgui: calcule elapsed_time when starting the loop | expand

Commit Message

Jose Quaresma July 10, 2023, 10:24 p.m. UTC
The function draw_label_in_box chooses the correct side based on
the maximum width length argument 'maxx'.
Currently the labels are always drawn on the left side and this
is because we are inadvertently passing the 'maxx' argument wrong.

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
---
 scripts/pybootchartgui/pybootchartgui/draw.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py
index e2f9c5dc6c..3d1ff695c1 100644
--- a/scripts/pybootchartgui/pybootchartgui/draw.py
+++ b/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -684,7 +684,7 @@  def render_processes_chart(ctx, options, trace, curr_y, width, h, sec_w):
 
             # Show elapsed time for each task
             process = "%ds %s" % (elapsed_time, process)
-            draw_label_in_box(ctx, PROC_TEXT_COLOR, process, x, y + proc_h - 4, w, proc_h)
+            draw_label_in_box(ctx, PROC_TEXT_COLOR, process, x, y + proc_h - 4, w, width)
 
             y = y + proc_h