forked from joejulian/gio
widget: clip by most complex shape last
In the new compute renderer, clipping to a complex shape is slower than filling it. Swap the clip shapes for drawing text so that the text shape itself is last, and therefore used for filling. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -178,8 +178,8 @@ func (l Label) Layout(gtx layout.Context, s text.Shaper, font text.Font, size un
|
||||
}
|
||||
stack := op.Save(gtx.Ops)
|
||||
op.Offset(layout.FPt(off)).Add(gtx.Ops)
|
||||
s.Shape(font, textSize, l).Add(gtx.Ops)
|
||||
clip.Rect(cl.Sub(off)).Add(gtx.Ops)
|
||||
s.Shape(font, textSize, l).Add(gtx.Ops)
|
||||
paint.PaintOp{}.Add(gtx.Ops)
|
||||
stack.Load()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user