Merge pull request #21426 from Snuffleupagus/rm-convertToViewportRectangle

[api-minor] Remove the unused `convertToViewportRectangle` method in the `PageViewport` class
This commit is contained in:
Tim van der Meij 2026-06-12 22:06:19 +02:00 committed by GitHub
commit ca34359e1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -190,7 +190,6 @@ class PageViewport {
* @returns {Array} Array containing `x`- and `y`-coordinates of the
* point in the viewport coordinate space.
* @see {@link convertToPdfPoint}
* @see {@link convertToViewportRectangle}
*/
convertToViewportPoint(x, y) {
const p = [x, y];
@ -198,21 +197,6 @@ class PageViewport {
return p;
}
/**
* Converts PDF rectangle to the viewport coordinates.
* @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.
* @returns {Array} Array containing corresponding coordinates of the
* rectangle in the viewport coordinate space.
* @see {@link convertToViewportPoint}
*/
convertToViewportRectangle(rect) {
const topLeft = [rect[0], rect[1]];
Util.applyTransform(topLeft, this.transform);
const bottomRight = [rect[2], rect[3]];
Util.applyTransform(bottomRight, this.transform);
return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];
}
/**
* Converts viewport coordinates to the PDF location. For examples, useful
* for converting canvas pixel location into PDF one.