aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/timer.go4
-rw-r--r--cmd/util.go5
2 files changed, 3 insertions, 6 deletions
diff --git a/cmd/timer.go b/cmd/timer.go
index 6058839..5f17f3f 100644
--- a/cmd/timer.go
+++ b/cmd/timer.go
@@ -58,10 +58,10 @@ func cmdTimer(cmd *cobra.Command, args []string) {
startTime := time.Now()
- drawTimer(scr, (timerTime - time.Now().Sub(startTime)).Round(time.Second), term.BgStyle, term.FgStyle)
+ drawTimer(scr, (timerTime - time.Since(startTime)).Round(time.Second), term.BgStyle, term.FgStyle)
scr.OnResize(func() bool {
- drawTimer(scr, (timerTime - time.Now().Sub(startTime)).Round(time.Second), term.BgStyle, term.FgStyle)
+ drawTimer(scr, (timerTime - time.Since(startTime)).Round(time.Second), term.BgStyle, term.FgStyle)
return false
})
go scr.DoEventLoop()
diff --git a/cmd/util.go b/cmd/util.go
index 93199da..0508e62 100644
--- a/cmd/util.go
+++ b/cmd/util.go
@@ -15,10 +15,7 @@ func calcSquareSize(scr *term.Screen) (int, int, int, int) {
// # # # # # # # # # |
// ### ### ### ### v
squareW := scrW / (17 + 2)
- squareH := scrH / (5 + 2)
- if squareH > squareW {
- squareH = squareW
- }
+ squareH := min(scrH/(5+2), squareW)
if squareW > squareH*3/2 {
squareW = squareH * 3 / 2
}