@itwin/core-frontend 3.2.0-dev.66 → 3.2.0-dev.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1021,7 +1021,7 @@ export declare abstract class Viewport implements IDisposable, TileUser {
1021
1021
  /** Read selected data about each pixel within a rectangular region of this Viewport.
1022
1022
  * @param rect The area of the viewport's contents to read. The origin specifies the upper-left corner. Must lie entirely within the viewport's dimensions. This input viewport is specified using CSS pixels not device pixels.
1023
1023
  * @param selector Specifies which aspect(s) of data to read.
1024
- * @param receiver A function accepting a [[Pixel.Buffer]] object from which the selected data can be retrieved, or receiving undefined if the viewport is not active, the rect is out of bounds, or some other error. The pixels received will be device pixels, not CSS pixels. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].
1024
+ * @param receiver A function accepting a [[Pixel.Buffer]] object from which the selected data can be retrieved, or receiving undefined if the viewport has been disposed, the rect is out of bounds, or some other error. The pixels received will be device pixels, not CSS pixels. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].
1025
1025
  * @param excludeNonLocatable If true, geometry with the "non-locatable" flag set will not be drawn.
1026
1026
  * @note The [[Pixel.Buffer]] supplied to the `receiver` function becomes invalid once that function exits. Do not store a reference to it.
1027
1027
  */
@@ -1948,13 +1948,13 @@ class Viewport {
1948
1948
  /** Read selected data about each pixel within a rectangular region of this Viewport.
1949
1949
  * @param rect The area of the viewport's contents to read. The origin specifies the upper-left corner. Must lie entirely within the viewport's dimensions. This input viewport is specified using CSS pixels not device pixels.
1950
1950
  * @param selector Specifies which aspect(s) of data to read.
1951
- * @param receiver A function accepting a [[Pixel.Buffer]] object from which the selected data can be retrieved, or receiving undefined if the viewport is not active, the rect is out of bounds, or some other error. The pixels received will be device pixels, not CSS pixels. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].
1951
+ * @param receiver A function accepting a [[Pixel.Buffer]] object from which the selected data can be retrieved, or receiving undefined if the viewport has been disposed, the rect is out of bounds, or some other error. The pixels received will be device pixels, not CSS pixels. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].
1952
1952
  * @param excludeNonLocatable If true, geometry with the "non-locatable" flag set will not be drawn.
1953
1953
  * @note The [[Pixel.Buffer]] supplied to the `receiver` function becomes invalid once that function exits. Do not store a reference to it.
1954
1954
  */
1955
1955
  readPixels(rect, selector, receiver, excludeNonLocatable = false) {
1956
1956
  const viewRect = this.viewRect;
1957
- if (!rect.isContained(viewRect))
1957
+ if (this.isDisposed || !rect.isContained(viewRect))
1958
1958
  receiver(undefined);
1959
1959
  else
1960
1960
  this.target.readPixels(rect, selector, receiver, excludeNonLocatable);