translation property

Vector2 get translation

The current translation is the difference in canvas units between the actual center of the canvas and the currently specified center. For example, if the actual canvas center is (5, 5) but the current center is (6, 6), the translation is (1, 1).

Implementation

Vector2 get translation => extents - center;
set translation (Vector2 translation)

Implementation

set translation(Vector2 translation) {
  center.setFrom(extents);
  center.sub(translation);
}