类型 Primitive

API 文档由 Go 源码生成,内容为英文。

type Primitive struct {
	Kind   PrimitiveKind
	Bounds ui.Rect
	Points [3]ui.Point
	Color  ui.Color
	Radius float32
	Layer  uint16
	// EdgeMask selects the boundary edges feathered for TrianglePrimitive.
	EdgeMask uint8
	// Shaded gives a TrianglePrimitive the colors Shade[0] and Shade[1] at
	// Points[1] and Points[2], Color being that of Points[0]; the color varies
	// linearly between them.
	Shaded bool
	Shade  [2]ui.Color
	// Shadow places and blurs a ShadowPrimitive.
	Shadow ui.ShadowStyle
	// Clipped reports that the primitive is drawn only inside Clip, a region of
	// the window in logical pixels that cuts it; Bounds and Points are whole.
	Clipped bool
	Clip    ui.Rect
}

Primitive is one retained instance to draw. Instances are in paint order within a layer; higher layers paint over lower ones.