aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/clock.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/clock.go')
-rw-r--r--cmd/clock.go20
1 files changed, 1 insertions, 19 deletions
diff --git a/cmd/clock.go b/cmd/clock.go
index 71244c4..71f01c7 100644
--- a/cmd/clock.go
+++ b/cmd/clock.go
@@ -13,25 +13,7 @@ func drawClock(scr *term.Screen, now time.Time, bgStyle, fgStyle term.Style) {
// Clear the entire screen.
scr.Clear(bgStyle)
- // Calculate square width/height and offset.
- scrW, scrH := scr.Size()
- // 17
- // <--------------->
- // ### ### ### ### ^
- // # # # # # # # # # |
- // # # # # # # # # | 5
- // # # # # # # # # # |
- // ### ### ### ### 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
+ squareW, squareH, xOffset, yOffset := calcSquareSize(scr)
// Hour
hour := now.Hour()