mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +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
|
// Click detects click gestures in the form
|
||||||
// of ClickEvents.
|
// of ClickEvents.
|
||||||
type Click struct {
|
type Click struct {
|
||||||
// state tracks the gesture state.
|
|
||||||
state ClickState
|
|
||||||
// clickedAt is the timestamp at which
|
// clickedAt is the timestamp at which
|
||||||
// the last click occurred.
|
// the last click occurred.
|
||||||
clickedAt time.Duration
|
clickedAt time.Duration
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type quadSplitter struct {
|
type quadSplitter struct {
|
||||||
verts []byte
|
|
||||||
bounds f32.Rectangle
|
bounds f32.Rectangle
|
||||||
contour uint32
|
contour uint32
|
||||||
d *drawOps
|
d *drawOps
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
// use some global variables for benchmarking so as to not pollute
|
// use some global variables for benchmarking so as to not pollute
|
||||||
// the reported allocs with allocations that we do not want to count.
|
// the reported allocs with allocations that we do not want to count.
|
||||||
var (
|
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
|
op1, op2, op3 op.Ops
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -49,8 +49,7 @@ type faceCache struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cache) lookup(font Font) *faceCache {
|
func (c *Cache) lookup(font Font) *faceCache {
|
||||||
var f *faceCache
|
f := c.faceForStyle(font)
|
||||||
f = c.faceForStyle(font)
|
|
||||||
if f == nil {
|
if f == nil {
|
||||||
font.Typeface = c.def
|
font.Typeface = c.def
|
||||||
f = c.faceForStyle(font)
|
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
|
// Use quadratic beziér curves to approximate a circle arc and
|
||||||
// minimize the error by capping the length of each curve segment.
|
// minimize the error by capping the length of each curve segment.
|
||||||
|
|
||||||
const maxSegments = 20.
|
|
||||||
nsegments := math.Round(20 * math.Pi / (endAngle - startAngle))
|
nsegments := math.Round(20 * math.Pi / (endAngle - startAngle))
|
||||||
|
|
||||||
θ := (endAngle - startAngle) / nsegments
|
θ := (endAngle - startAngle) / nsegments
|
||||||
|
|||||||
Reference in New Issue
Block a user