ImageScaledCache constructor

ImageScaledCache(
  1. CanvasImageSource _image, [
  2. int? width,
  3. int? height,
  4. int? maxScaleCacheEntries,
])

Implementation

ImageScaledCache(this._image,
    [int? width, int? height, int? maxScaleCacheEntries]) {
  if (width == null || height == null) {
    var wh = getImageDimension(_image)!;

    width ??= wh.width;
    height ??= wh.height;
  }

  _width = width;
  _height = height;

  _maxScaleCacheEntries =
      maxScaleCacheEntries != null && maxScaleCacheEntries > 0
          ? maxScaleCacheEntries
          : 2;
}