Example #1
0
  // modify the canvas itself
  @Override
  public synchronized ICanvas setSize(V2 size) {
    // reset size
    this.size = size;

    // reset camera
    if (use_camera) camera.setProjectionSize(size);

    return this;
  }
Example #2
0
  @Override
  public synchronized ICanvas setCamera(ICamera camera) {
    // attach camera and reset its field size
    this.camera = camera;
    camera.setProjectionSize(size);

    // maintain invariant: (camera == null) => use_camera = false
    if (!use_camera && camera != null) use_camera = true;
    else if (camera == null) use_camera = false;

    return this;
  }