changeAspectRatio method

void changeAspectRatio({
  1. required double width,
  2. required double height,
})

Adjust the envelope's aspect ratio to match the ratio of the given width and height.

The operation preserves the center of the envelope and only increases either height or width, not both. If the new width would be greater than the old, the width is changed and the height remains the same. If the new width would be less than or equal to the old, the height is changed and the width remains the same.

Parameters:

  • width — A width.
  • height — A height.

Implementation

void changeAspectRatio({
  required double width,
  required double height,
}) {
  _withThrowingErrorHandler((errorHandler) {
    runtimecore.RT_EnvelopeBuilder_changeAspectRatio(
      _handle,
      width,
      height,
      errorHandler,
    );
  });
}