mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
gpu,op/clip: implement stroked paths
Flat and Square caps are implemented. Bevel joins are implemented. Round caps, Round joins and Miter joins are left for another PR. Signed-off-by: Sebastien Binet <s@sbinet.org>
This commit is contained in:
committed by
Elias Naur
parent
936eb52b7e
commit
33c5fb63db
@@ -0,0 +1,23 @@
|
||||
// SPDX-License-Identifier: Unlicense OR MIT
|
||||
|
||||
package clip
|
||||
|
||||
// StrokeStyle describes how a stroked path should be drawn.
|
||||
// StrokeStyle zero value draws a Bevel-joined and Flat-capped stroked path.
|
||||
type StrokeStyle struct {
|
||||
Cap StrokeCap
|
||||
}
|
||||
|
||||
// StrokeCap describes the head or tail of a stroked path.
|
||||
type StrokeCap uint8
|
||||
|
||||
const (
|
||||
// FlatCap caps stroked paths with a flat cap, joining the right-hand
|
||||
// and left-hand sides of a stroked path with a straight line.
|
||||
FlatCap StrokeCap = iota
|
||||
|
||||
// SquareCap caps stroked paths with a square cap, joining the right-hand
|
||||
// and left-hand sides of a stroked path with a half square of length
|
||||
// the stroked path's width.
|
||||
SquareCap
|
||||
)
|
||||
Reference in New Issue
Block a user