mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
gpu,op/clip: implement stroked paths with round joins
Signed-off-by: Sebastien Binet <s@sbinet.org>
This commit is contained in:
committed by
Elias Naur
parent
f3f32ed7aa
commit
700cec440e
@@ -54,6 +54,7 @@ func (p Op) Add(o *op.Ops) {
|
||||
bo.PutUint32(data[13:], uint32(p.bounds.Max.Y))
|
||||
bo.PutUint32(data[17:], math.Float32bits(p.width))
|
||||
data[21] = uint8(p.style.Cap)
|
||||
data[22] = uint8(p.style.Join)
|
||||
}
|
||||
|
||||
// Begin the path, storing the path data and final Op into ops.
|
||||
|
||||
+15
-2
@@ -3,9 +3,11 @@
|
||||
package clip
|
||||
|
||||
// StrokeStyle describes how a stroked path should be drawn.
|
||||
// StrokeStyle zero value draws a Bevel-joined and Flat-capped stroked path.
|
||||
// The zero value of StrokeStyle represents bevel-joined and flat-capped
|
||||
// strokes.
|
||||
type StrokeStyle struct {
|
||||
Cap StrokeCap
|
||||
Cap StrokeCap
|
||||
Join StrokeJoin
|
||||
}
|
||||
|
||||
// StrokeCap describes the head or tail of a stroked path.
|
||||
@@ -26,3 +28,14 @@ const (
|
||||
// stroked path's width.
|
||||
RoundCap
|
||||
)
|
||||
|
||||
// StrokeJoin describes how stroked paths are collated.
|
||||
type StrokeJoin uint8
|
||||
|
||||
const (
|
||||
// BevelJoin joins path segments with sharp bevels.
|
||||
BevelJoin StrokeJoin = iota
|
||||
|
||||
// RoundJoin joins path segments with a round segment.
|
||||
RoundJoin
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user