mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
all: implement staticcheck suggestions
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -29,8 +29,6 @@ const doubleClickDuration = 200 * time.Millisecond
|
||||
// Click detects click gestures in the form
|
||||
// of ClickEvents.
|
||||
type Click struct {
|
||||
// state tracks the gesture state.
|
||||
state ClickState
|
||||
// clickedAt is the timestamp at which
|
||||
// the last click occurred.
|
||||
clickedAt time.Duration
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
)
|
||||
|
||||
type quadSplitter struct {
|
||||
verts []byte
|
||||
bounds f32.Rectangle
|
||||
contour uint32
|
||||
d *drawOps
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
// use some global variables for benchmarking so as to not pollute
|
||||
// the reported allocs with allocations that we do not want to count.
|
||||
var (
|
||||
c1, c2, c3 = make(chan op.CallOp, 0), make(chan op.CallOp, 0), make(chan op.CallOp, 0)
|
||||
c1, c2, c3 = make(chan op.CallOp), make(chan op.CallOp), make(chan op.CallOp)
|
||||
op1, op2, op3 op.Ops
|
||||
)
|
||||
|
||||
|
||||
+1
-2
@@ -49,8 +49,7 @@ type faceCache struct {
|
||||
}
|
||||
|
||||
func (c *Cache) lookup(font Font) *faceCache {
|
||||
var f *faceCache
|
||||
f = c.faceForStyle(font)
|
||||
f := c.faceForStyle(font)
|
||||
if f == nil {
|
||||
font.Typeface = c.def
|
||||
f = c.faceForStyle(font)
|
||||
|
||||
@@ -73,7 +73,6 @@ func clipLoader(ops *op.Ops, startAngle, endAngle, radius float64) {
|
||||
// Use quadratic beziér curves to approximate a circle arc and
|
||||
// minimize the error by capping the length of each curve segment.
|
||||
|
||||
const maxSegments = 20.
|
||||
nsegments := math.Round(20 * math.Pi / (endAngle - startAngle))
|
||||
|
||||
θ := (endAngle - startAngle) / nsegments
|
||||
|
||||
Reference in New Issue
Block a user