From 9bfd38c5f9d60f6ca4e2737866e595be1336d967 Mon Sep 17 00:00:00 2001 From: Steffen Breiler Date: Thu, 18 Sep 2014 01:26:52 +0200 Subject: [PATCH] Fix percent function to return minimum zero The percent function is used for ui-bars. When returning numbers below zero the bar will show up with 100% width, 'cause css don't know negative width. --- script/index.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/index.coffee b/script/index.coffee index d007bfde55..37c006f871 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -199,7 +199,7 @@ api.percent = (x,y, dir) -> when "down" then roundFn = Math.floor else roundFn = Math.round x=1 if x==0 - roundFn(x/y*100) + Math.max(0,roundFn(x/y*100)) ### Remove whitespace #FIXME are we using this anywwhere? Should we be?