package stroke
import "gioui.org/internal/stroke"
Package stroke implements conversion of strokes to filled outlines. It is used as a fallback for stroke configurations not natively supported by the renderer.
Index ¶
- func ArcTransform(p, f1, f2 f32.Point, angle float32) (transform f32.Affine2D, segments int)
- type QuadSegment
- func SplitCubic(from, ctrl0, ctrl1, to f32.Point, quads []QuadSegment) []QuadSegment
- func (q QuadSegment) Transform(t f32.Affine2D) QuadSegment
- type StrokeQuad
- type StrokeQuads
- type StrokeStyle
Functions ¶
func ArcTransform ¶
ArcTransform computes a transformation that can be used for generating quadratic bézier curve approximations for an arc.
The math is extracted from the following paper:
"Drawing an elliptical arc using polylines, quadratic or cubic Bezier curves", L. Maisonobe
An electronic version may be found at:
http://spaceroots.org/documents/ellipse/elliptical-arc.pdf
Types ¶
type QuadSegment ¶
func SplitCubic ¶
func SplitCubic(from, ctrl0, ctrl1, to f32.Point, quads []QuadSegment) []QuadSegment
func (QuadSegment) Transform ¶
func (q QuadSegment) Transform(t f32.Affine2D) QuadSegment
type StrokeQuad ¶
type StrokeQuad struct { Contour uint32 Quad QuadSegment }
type StrokeQuads ¶
type StrokeQuads []StrokeQuad
func StrokePathCommands ¶
func StrokePathCommands(style StrokeStyle, scene []byte) StrokeQuads
type StrokeStyle ¶
type StrokeStyle struct { Width float32 }
The following are copies of types from op/clip to avoid a circular import of that package. TODO: when the old renderer is gone, this package can be merged with op/clip, eliminating the duplicate types.
Source Files ¶
stroke.go
- Version
- v0.7.2
- Published
- Jul 15, 2024
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 2 minutes ago –
Tools for package owners.