mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
ui: build paths as ops
Instead of allocating and constructing a clip path, store path data directly in op lists. Use separate op lists for cached text layout paths. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-2
@@ -100,11 +100,10 @@ func (l Label) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens {
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
path := l.Face.Path(str)
|
||||
lclip := toRectF(clip).Sub(off)
|
||||
ui.OpPush{}.Add(ops)
|
||||
ui.OpTransform{Transform: ui.Offset(off)}.Add(ops)
|
||||
draw.OpClip{Path: path}.Add(ops)
|
||||
l.Face.Path(str).Add(ops)
|
||||
draw.OpDraw{Rect: lclip}.Add(ops)
|
||||
ui.OpPop{}.Add(ops)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user