spreadsheet

terminal spreadsheet application
git clone https://git.ce9e.org/spreadsheet.git

commit
9a1a335d2e4dadd371fee6e06f579f74145ba164
parent
dbe98a7f200575f2d3a76853c060f59dec211b52
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2024-07-21 09:59
fix: bar with when full

Diffstat

M sheet/sheet.py 7 +++++--

1 files changed, 5 insertions, 2 deletions


diff --git a/sheet/sheet.py b/sheet/sheet.py

@@ -11,9 +11,12 @@ class Bar:
   11    11 
   12    12     def render(self, width):
   13    13         value = max(0, min(1, self.value))
   14    -1         x = int(value * width * (len(BLOCKS) - 1))
   -1    14         x = round(value * width * (len(BLOCKS) - 1))
   15    15         a, b = divmod(x, len(BLOCKS) - 1)
   16    -1         return a * BLOCKS[-1] + BLOCKS[b] + (width - a - 1) * BLOCKS[0]
   -1    16         if a == width:
   -1    17             return a * BLOCKS[-1]
   -1    18         else:
   -1    19             return a * BLOCKS[-1] + BLOCKS[b] + (width - a - 1) * BLOCKS[0]
   17    20 
   18    21 
   19    22 def iter_range(cell1, cell2):