diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-11-13 10:57:26 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-11-13 10:57:26 +0900 |
| commit | 09e13fbf0462e801626d259ae901d5f430d7ebdf (patch) | |
| tree | 8a3884d53a5657ef8bc47ee135c225f23741edb1 | |
| parent | 5ae35c65eb33a2dc1326ae25cf09119d61ffdb84 (diff) | |
| download | big-clock-mode-09e13fbf0462e801626d259ae901d5f430d7ebdf.tar.gz big-clock-mode-09e13fbf0462e801626d259ae901d5f430d7ebdf.tar.zst big-clock-mode-09e13fbf0462e801626d259ae901d5f430d7ebdf.zip | |
improve square ratiov1.0.1
| -rw-r--r-- | main.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -118,6 +118,12 @@ func drawClock(scr tcell.Screen, now time.Time, bgStyle, clockStyle tcell.Style) // ### ### ### ### v squareW := scrW / (17 + 2) squareH := scrH / (5 + 2) + if squareH > squareW { + squareH = squareW + } + if squareW > squareH*3/2 { + squareW = squareH * 3 / 2 + } xOffset := (scrW - squareW*17) / 2 yOffset := (scrH - squareH*5) / 2 |
