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

Method Translate

path.go:1344–1346  ·  view source on GitHub ↗

Translate translates the path by (x,y). It modifies the path in-place.

(x, y float64)

Source from the content-addressed store, hash-verified

1342
1343// Translate translates the path by (x,y). It modifies the path in-place.
1344func (p *Path) Translate(x, y float64) *Path {
1345 return p.Transform(Identity.Translate(x, y))
1346}
1347
1348// Scale scales the path by (sx,sy). It modifies the path in-place.
1349func (p *Path) Scale(sx, sy float64) *Path {

Callers 15

DVI2PathFunction · 0.95
mainFunction · 0.95
DrawPreviewWithAssetsFunction · 0.45
ParseLaTeXFunction · 0.45
renderBlockMethod · 0.45
TestMatrixFunction · 0.45
MarkersMethod · 0.45
ViewMethod · 0.45
renderLineToMethod · 0.45
initMethod · 0.45
parseTransformMethod · 0.45
parseDefsMethod · 0.45

Calls 1

TransformMethod · 0.95

Tested by 4

TestMatrixFunction · 0.36
TestPathTransformFunction · 0.36
BenchmarkToRasterizerFunction · 0.36
BenchmarkToScanxFunction · 0.36