@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.34 kB
JavaScript
import{f as t}from"../../../../chunks/vec2f64.js";import{TextRenderAlignment as e}from"../../webgl-engine/lib/TextRenderer.js";const r=Object.freeze({left:0,center:.5,right:1}),o=Object.freeze({"bottom-left":t(0,0),bottom:t(.5,0),"bottom-right":t(1,0),left:t(0,.5),center:t(.5,.5),right:t(1,.5),"top-left":t(0,1),top:t(.5,1),"top-right":t(1,1)});function c(t){switch(t){case"left":return e.Left;case"right":return e.Right;default:return e.Center}}function n(t){switch(t){case"bottom-left":case"left":case"top-left":return"left";case"bottom":case"center":case"top":return"center";case"bottom-right":case"right":case"top-right":return"right"}}function s(t){switch(t){case"bottom-left":case"bottom":case"bottom-right":return"bottom";case"left":case"center":case"right":return"center";case"top-left":case"top":case"top-right":return"top"}}function i(t,e){switch(e){case"bottom":return"left"===t?"bottom-left":"right"===t?"bottom-right":"bottom";case"center":return t;case"top":return"left"===t?"top-left":"right"===t?"top-right":"top"}}function f(t){return"middle"===t?"center":t}export{i as anchorFromPlacements,n as horizontalPlacementFromAnchor,r as horizontalPlacementToAnchorX,o as namedAnchorToHUDMaterialAnchorPos,c as textRenderAlignmentFromHorizontalPlacement,f as verticalPlacementFromAlignment,s as verticalPlacementFromAnchor};