Skip to content

Commit

Permalink
Simplify code and removing deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
hugmouse authored and aarzilli committed Oct 12, 2019
1 parent 70fc770 commit b688ec4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b688ec4

Please sign in to comment.