ui/draw,ui/layout: export OpClip

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-17 16:45:49 +02:00
parent 1765a66fd6
commit d67b7eca6c
3 changed files with 9 additions and 8 deletions
+5 -4
View File
@@ -23,12 +23,13 @@ type PathBuilder struct {
hasBounds bool
}
// opClip structure must match opClip in package ui/internal/gpu.
type opClip struct {
// OpClip structure must match opClip in package ui/internal/gpu.
type OpClip struct {
bounds f32.Rectangle
}
func (p opClip) Add(o *ui.Ops) {
func (p OpClip) Add(o *ui.Ops) {
data := make([]byte, ops.TypeClipLen)
data[0] = byte(ops.TypeClip)
bo := binary.LittleEndian
@@ -277,7 +278,7 @@ func (p *PathBuilder) simpleQuadTo(ctrl, to f32.Point) {
func (p *PathBuilder) End() {
p.end()
opClip{
OpClip{
bounds: p.bounds,
}.Add(p.ops)
}