mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
internal/stroke, op/clip: remove unused variables
Fixes gio#233 Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
@@ -696,7 +696,7 @@ func ArcTransform(p, f1, f2 f32.Point, angle float32, segments int) f32.Affine2D
|
|||||||
f := dist(f1, c)
|
f := dist(f1, c)
|
||||||
b := math.Sqrt(a*a - f*f)
|
b := math.Sqrt(a*a - f*f)
|
||||||
|
|
||||||
var rx, ry, alpha, start float64
|
var rx, ry, alpha float64
|
||||||
switch {
|
switch {
|
||||||
case a > b:
|
case a > b:
|
||||||
rx = a
|
rx = a
|
||||||
@@ -728,12 +728,6 @@ func ArcTransform(p, f1, f2 f32.Point, angle float32, segments int) f32.Affine2D
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start = math.Acos(float64(p.X-c.X) / dist(c, p))
|
|
||||||
if c.Y > p.Y {
|
|
||||||
start = -start
|
|
||||||
}
|
|
||||||
start -= alpha
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
θ = angle / float32(segments)
|
θ = angle / float32(segments)
|
||||||
ref f32.Affine2D // transform from absolute frame to ellipse-based one
|
ref f32.Affine2D // transform from absolute frame to ellipse-based one
|
||||||
|
|||||||
+1
-3
@@ -27,15 +27,13 @@ type Op struct {
|
|||||||
|
|
||||||
func (p Op) Add(o *op.Ops) {
|
func (p Op) Add(o *op.Ops) {
|
||||||
str := p.stroke
|
str := p.stroke
|
||||||
dashes := p.dashes
|
|
||||||
path := p.path
|
path := p.path
|
||||||
outline := p.outline
|
outline := p.outline
|
||||||
approx := str.Width > 0 && !(dashes == DashSpec{} && str.Miter == 0 && str.Join == RoundJoin && str.Cap == RoundCap)
|
approx := str.Width > 0 && !(p.dashes == DashSpec{} && str.Miter == 0 && str.Join == RoundJoin && str.Cap == RoundCap)
|
||||||
if approx {
|
if approx {
|
||||||
// If the stroke is not natively supported by the compute renderer, construct a filled path
|
// If the stroke is not natively supported by the compute renderer, construct a filled path
|
||||||
// that approximates it.
|
// that approximates it.
|
||||||
path = p.approximateStroke(o)
|
path = p.approximateStroke(o)
|
||||||
dashes = DashSpec{}
|
|
||||||
str = StrokeStyle{}
|
str = StrokeStyle{}
|
||||||
outline = true
|
outline = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user