mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
text,widget,opentype: change text.Face.Shape to return a clip.PathSpec
With this change, the Shape function returns a clip.PathSpec instead of a clip.Outline op. It is then possible to create a clip.Outline or clip.Stroke op to fill the text path or draw its stroke. Signed-off-by: Christophe Meessen <meessen@cppm.in2p3.fr>
This commit is contained in:
committed by
Elias Naur
parent
3db11cbaad
commit
a34e239c04
+2
-2
@@ -531,8 +531,8 @@ func (e *Editor) layout(gtx layout.Context, content layout.Widget) layout.Dimens
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
path := e.shaper.Shape(e.font, e.textSize, layout)
|
||||
e.shapes = append(e.shapes, line{off, path, selected, yOffs, size})
|
||||
op := clip.Outline{Path: e.shaper.Shape(e.font, e.textSize, layout)}.Op()
|
||||
e.shapes = append(e.shapes, line{off, op, selected, yOffs, size})
|
||||
}
|
||||
|
||||
key.InputOp{Tag: &e.eventKey, Hint: e.InputHint}.Add(gtx.Ops)
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ func (l Label) Layout(gtx layout.Context, s text.Shaper, font text.Font, size un
|
||||
}
|
||||
t := op.Offset(layout.FPt(off)).Push(gtx.Ops)
|
||||
rcl := clip.Rect(cl.Sub(off)).Push(gtx.Ops)
|
||||
cl := s.Shape(font, textSize, l).Push(gtx.Ops)
|
||||
cl := clip.Outline{Path: s.Shape(font, textSize, l)}.Op().Push(gtx.Ops)
|
||||
paint.PaintOp{}.Add(gtx.Ops)
|
||||
cl.Pop()
|
||||
rcl.Pop()
|
||||
|
||||
Reference in New Issue
Block a user