From b688ec4538540d3e091f1a36588fb515377af0e3 Mon Sep 17 00:00:00 2001 From: Mysh! Date: Tue, 8 Oct 2019 16:21:25 +0800 Subject: [PATCH] Simplify code and removing deprecated function --- context.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/context.go b/context.go index 5d2b008..c36d5ba 100644 --- a/context.go +++ b/context.go @@ -539,12 +539,12 @@ func (ctx *context) Draw(wimg *image.RGBA) int { if perfUpdate { if bordopt { - brecttim += time.Now().Sub(t0) + brecttim += time.Since(t0) } else { if cmd.Rounding > 0 { - frrecttim += time.Now().Sub(t0) + frrecttim += time.Since(t0) } else { - d := time.Now().Sub(t0) + d := time.Since(t0) if op == draw.Src { frecttim += d } else { @@ -574,7 +574,7 @@ func (ctx *context) Draw(wimg *image.RGBA) int { ftri++ if perfUpdate { - tritim += time.Now().Sub(t0) + tritim += time.Since(t0) } case command.CircleFilledCmd: @@ -613,7 +613,7 @@ func (ctx *context) Draw(wimg *image.RGBA) int { } txt++ if perfUpdate { - txttim += time.Now().Sub(t0) + txttim += time.Since(t0) } default: panic(UnknownCommandErr) @@ -952,7 +952,7 @@ func (t *dockedTree) Undock(win *Window) { func (t *dockedTree) Scale(win *Window, delta image.Point, scaling float64) image.Point { if t == nil || (delta.X == 0 && delta.Y == 0) { - return image.ZP + return image.Point{} } switch t.Type { case dockedNodeVert: @@ -986,7 +986,7 @@ func (t *dockedTree) Scale(win *Window, delta image.Point, scaling float64) imag return delta } } - return image.ZP + return image.Point{} } func (ctx *context) ResetWindows() *DockSplit {