Take view padding into account for calculateExtent()

This commit is contained in:
Andreas Hocevar
2021-01-22 20:08:05 +01:00
parent 9e6ec55758
commit 900107df1d
2 changed files with 16 additions and 1 deletions

View File

@@ -921,7 +921,7 @@ class View extends BaseObject {
* @return {import("./extent.js").Extent} Extent.
*/
calculateExtentInternal(opt_size) {
const size = opt_size || this.getViewportSize_();
const size = opt_size || this.getViewportSizeMinusPadding_();
const center = /** @type {!import("./coordinate.js").Coordinate} */ (this.getCenterInternal());
assert(center, 1); // The view center is not defined
const resolution = /** @type {!number} */ (this.getResolution());