mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
op: change CallOp to be a return value from MacroOp.Stop
Converting macro := op.Record(ops) ... macro.Stop() macro.Add() to macro := op.Record(ops) ... call := macro.Stop() call.Add(ops) Which is more general (call.Add can take a different ops than the op.Record that started it), and enforced the order between Stop and the subsequent Add. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -185,6 +185,7 @@ func textPath(buf *sfnt.Buffer, ppem fixed.Int26_6, f *opentype, str []text.Glyp
|
||||
var lastPos f32.Point
|
||||
var builder clip.Path
|
||||
ops := new(op.Ops)
|
||||
m := op.Record(ops)
|
||||
var x fixed.Int26_6
|
||||
builder.Begin(ops)
|
||||
for _, g := range str {
|
||||
@@ -238,7 +239,7 @@ func textPath(buf *sfnt.Buffer, ppem fixed.Int26_6, f *opentype, str []text.Glyp
|
||||
x += g.Advance
|
||||
}
|
||||
builder.End().Add(ops)
|
||||
return op.CallOp{Ops: ops}
|
||||
return m.Stop()
|
||||
}
|
||||
|
||||
func readGlyphs(r io.Reader) ([]text.Glyph, error) {
|
||||
|
||||
Reference in New Issue
Block a user