@itwin/core-frontend 3.2.0-dev.64 → 3.2.0-dev.67

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
  */
@@ -1945,13 +1945,13 @@ export class Viewport {
1945
1945
  /** Read selected data about each pixel within a rectangular region of this Viewport.
1946
1946
  * @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.
1947
1947
  * @param selector Specifies which aspect(s) of data to read.
1948
- * @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]].
1948
+ * @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]].
1949
1949
  * @param excludeNonLocatable If true, geometry with the "non-locatable" flag set will not be drawn.
1950
1950
  * @note The [[Pixel.Buffer]] supplied to the `receiver` function becomes invalid once that function exits. Do not store a reference to it.
1951
1951
  */
1952
1952
  readPixels(rect, selector, receiver, excludeNonLocatable = false) {
1953
1953
  const viewRect = this.viewRect;
1954
- if (!rect.isContained(viewRect))
1954
+ if (this.isDisposed || !rect.isContained(viewRect))
1955
1955
  receiver(undefined);
1956
1956
  else
1957
1957
  this.target.readPixels(rect, selector, receiver, excludeNonLocatable);