op/paint: return ClipOp from Path.End

Instead of adding an implicit ClipOp, return a ClipOp ready to use, freeing the
caller from recording a macro.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-09 15:05:09 +02:00
parent a937a76534
commit ef5cf5b724
6 changed files with 36 additions and 29 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import (
"image"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/op/paint"
"golang.org/x/image/math/fixed"
)
@@ -64,8 +64,8 @@ type Family interface {
// Layout returns the text layout for a string given a set of
// options.
Layout(face Face, size float32, s string, opts LayoutOptions) *Layout
// Path returns the ClipOp outline of a text recorded in a macro.
Shape(face Face, size float32, s String) op.MacroOp
// Path returns the ClipOp outline of a text.
Shape(face Face, size float32, s String) paint.ClipOp
}
type Alignment uint8