MCPcopy Create free account
hub / github.com/tdewolff/canvas / Translate

Method Translate

util.go:429–435  ·  view source on GitHub ↗

Translate translates the rect.

(x, y float64)

Source from the content-addressed store, hash-verified

427
428// Translate translates the rect.
429func (r Rect) Translate(x, y float64) Rect {
430 r.X0 += x
431 r.Y0 += y
432 r.X1 += x
433 r.Y1 += y
434 return r
435}
436
437// Transform transforms the rectangle by affine transformation matrix m and returns the new bounds of that rectangle.
438func (r Rect) Transform(m Matrix) Rect {

Callers 7

TestRectFunction · 0.95
ToPathMethod · 0.45
RotateAboutMethod · 0.45
ScaleAboutMethod · 0.45
ShearAboutMethod · 0.45
ReflectXAboutMethod · 0.45
ReflectYAboutMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestRectFunction · 0.76