localToGlobal method

Vector2 localToGlobal(
  1. Vector2 position, {
  2. Vector2? output,
})

Converts from the local (camera = viewport + viewfinder) coordinate space to global (canvas).

Opposite of globalToLocal.

Implementation

Vector2 localToGlobal(Vector2 position, {Vector2? output}) {
  final viewfinderPosition =
      viewfinder.localToGlobal(position, output: output);
  return viewport.localToGlobal(viewfinderPosition, output: output);
}