MCPcopy
hub / github.com/tdewolff/canvas / WritePath

Method WritePath

text.go:551–558  ·  view source on GitHub ↗

WritePath writes an inline path.

(path *Path, col color.RGBA, valign VerticalAlign)

Source from the content-addressed store, hash-verified

549
550// WritePath writes an inline path.
551func (rt *RichText) WritePath(path *Path, col color.RGBA, valign VerticalAlign) {
552 style := DefaultStyle
553 style.Fill.Color = col
554 bounds := path.Bounds()
555 c := New(bounds.X1, bounds.Y1)
556 c.RenderPath(path, style, Identity)
557 rt.WriteCanvas(c, valign)
558}
559
560// WriteImage writes an inline image.
561func (rt *RichText) WriteImage(img image.Image, res Resolution, valign VerticalAlign) {

Callers 3

WriteLaTeXMethod · 0.95
AddPathMethod · 0.95
mainFunction · 0.95

Calls 4

WriteCanvasMethod · 0.95
NewFunction · 0.70
RenderPathMethod · 0.65
BoundsMethod · 0.45

Tested by

no test coverage detected