Commit Diff
Diff:
d42a3617d39dbf190f7ecb0dde84f65b54b62e61
1b135dc5bb5281071f67d2d5c3d44db56fc6ca54
Commit:
1b135dc5bb5281071f67d2d5c3d44db56fc6ca54
Tree:
9c3b3a43fb2c57e5da3eff842f92ab750e05ed90
Author:
Omar Polo <op@omarpolo.com>
Date:
Tue Jul 26 06:59:44 2022 UTC
Message:
fix off by one in the offsets line
commit - d42a3617d39dbf190f7ecb0dde84f65b54b62e61
commit + 1b135dc5bb5281071f67d2d5c3d44db56fc6ca54
blob - 1eb74ec5758e31c663403ad0214c2d7dd58bbb02
blob + ef48647559c9655fc6b9b97fdcaea31a123ac12b
--- contrib/amused-monitor
+++ contrib/amused-monitor
@@ -133,9 +133,9 @@ sub center {
my ($str, $pstr) = @_;
my $width = mbswidth($str);
return $str if $width > $COLS;
- my $pre = ($COLS - $width) / 2;
+ my $pre = round(($COLS - $width) / 2);
my $lpad = $pstr x $pre;
- my $rpad = $pstr x ($COLS - $width - $pre + 1);
+ my $rpad = $pstr x ($COLS - $width - $pre);
return ($lpad, $str, $rpad);
}
Omar Polo