X-Git-Url: http://git.shiar.net/barcat.git/blobdiff_plain/b2284fb09db3525ea8a930c98d6fe493e51ca45c..b1e1adebfd115dcd80e65a2a505d9d0ed5f96c43:/barcat?ds=sidebyside diff --git a/barcat b/barcat index 753e323..0445249 100755 --- a/barcat +++ b/barcat @@ -287,6 +287,7 @@ my @barmark; if ($opt{markers} and $size > 0) { for my $markspec (split /\h/, $opt{markers}) { my ($char, $func) = split //, $markspec, 2; + my $increment = $func =~ s/[+]\z//; my @pos = eval { if ($func eq 'avg') { return sum(@order) / @order; @@ -321,7 +322,8 @@ if ($opt{markers} and $size > 0) { $pos -= $minval; $pos &&= log $pos if $opt{log}; $pos >= 0 or next; - color(36) for $barmark[$pos / $range * $size] = $char; + $increment ||= $minval && !$pos; + color(36) for $barmark[$pos / $range * $size + $increment + .5] = $char; } }