aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2021-11-13 10:57:26 +0900
committernsfisis <nsfisis@gmail.com>2021-11-13 10:57:26 +0900
commit09e13fbf0462e801626d259ae901d5f430d7ebdf (patch)
tree8a3884d53a5657ef8bc47ee135c225f23741edb1 /main.go
parent5ae35c65eb33a2dc1326ae25cf09119d61ffdb84 (diff)
downloadbig-clock-mode-09e13fbf0462e801626d259ae901d5f430d7ebdf.tar.gz
big-clock-mode-09e13fbf0462e801626d259ae901d5f430d7ebdf.tar.zst
big-clock-mode-09e13fbf0462e801626d259ae901d5f430d7ebdf.zip
improve square ratiov1.0.1
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index 27709ec..9841b34 100644
--- a/main.go
+++ b/main.go
@@ -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