UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 729 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{px2pt as n,pt2px as e}from"../../../../core/screenUtils.js";import r from"../../../../geometry/Polygon.js";import{minTextLineWidth as t,maxTextLineWidth as o}from"../../engine/webgl/definitions.js";const i=50;function m(n){if(!n)return null;const{xmin:e,ymin:t,xmax:o,ymax:i,spatialReference:m}=n;return new r({rings:[[[e,t],[e,i],[o,i],[o,t],[e,t]]],spatialReference:m})}function s(r){return n(Math.round(e(r)))}function a(e){const r=n(t),i=n(o);return Math.max(r,Math.min(e||i,i))}export{a as getLineWidth,i as pixelBuffer,m as polygonFromExtent,s as roundPtToWholePixel};