aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
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