diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-12-14 22:14:13 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-12-14 22:14:13 -0800 |
commit | 001efc35f0702c5a0994b6bc11ebce4e3176be3e (patch) | |
tree | 78b1ec3c50794e16b2bab70ba5cfdd999ad14205 /apps/tile/value.mu | |
parent | 670cbb3d33807efb2d5e0db9e54ffed42f7ef0e3 (diff) | |
download | mu-001efc35f0702c5a0994b6bc11ebce4e3176be3e.tar.gz |
7352
Diffstat (limited to 'apps/tile/value.mu')
-rw-r--r-- | apps/tile/value.mu | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/tile/value.mu b/apps/tile/value.mu index 3cb93a1d..912f9ffa 100644 --- a/apps/tile/value.mu +++ b/apps/tile/value.mu @@ -1,4 +1,4 @@ -fn render-value-at screen: (addr screen), row: int, col: int, _val: (addr value), max-width: int { +fn render-value-at screen: (addr screen), row: int, col: int, _val: (addr value), top-level?: boolean { move-cursor screen, row, col var val/esi: (addr value) <- copy _val var val-type/ecx: (addr int) <- get val, type @@ -58,14 +58,14 @@ fn render-value-at screen: (addr screen), row: int, col: int, _val: (addr value) } # render ints by default for now var val-num/eax: (addr float) <- get val, number-data - render-number screen, *val-num, max-width + render-number screen, *val-num, top-level? } # synaesthesia # TODO: right-justify -fn render-number screen: (addr screen), val: float, max-width: int { - # if max-width is 0, we're inside an array. No coloring. - compare max-width, 0 +fn render-number screen: (addr screen), val: float, top-level?: boolean { + # if we're inside an array, don't color + compare top-level?, 0 { break-if-!= print-float-decimal-approximate screen, val, 3 |