From dbb552097c51a7b961012880525ccb787a09eaac Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 26 Jan 2019 11:03:39 -0500 Subject: [PATCH] arcchart: Also compute the sum when the limits are provided. The result was used even when it wasn't computed. --- lib/wibox/container/arcchart.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/wibox/container/arcchart.lua b/lib/wibox/container/arcchart.lua index 301ce128..f2754146 100644 --- a/lib/wibox/container/arcchart.lua +++ b/lib/wibox/container/arcchart.lua @@ -104,10 +104,11 @@ function arcchart:after_draw_children(_, cr, width, height) local max_val = self:get_max_value() local sum = 0 + for _, v in ipairs(values) do + sum = sum + v + end + if not max_val then - for _, v in ipairs(values) do - sum = sum + v - end max_val = sum end