5 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			5 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
 | 
						|
 | 
						|
import{parentNode,closest,getElementRect}from"./domUtils.prod.js";import extend from"./extend.prod.js";import is from"./is.prod.js";import"./browser.prod.js";import"./domObjects.prod.js";import"./window.prod.js";import"./isWindow.prod.js";function getStringOptionResult(t,o,e){return"parent"===t?parentNode(e):"self"===t?o.getRect(e):closest(e,t)}function resolveRectLike(t,o,e,i){let r=t;return is.string(r)?r=getStringOptionResult(r,o,e):is.func(r)&&(r=r(...i)),is.element(r)&&(r=getElementRect(r)),r}function toFullRect(t){var o,e;const{top:i,left:r,bottom:n,right:l}=t;return{top:i,left:r,bottom:n,right:l,width:null!=(o=t.width)?o:t.right-t.left,height:null!=(e=t.height)?e:t.bottom-t.top}}function rectToXY(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}}function xywhToTlbr(t){return!t||"left"in t&&"top"in t||((t=extend({},t)).left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t}function tlbrToXywh(t){return!t||"x"in t&&"y"in t||((t=extend({},t)).x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t}function addEdges(t,o,e){t.left&&(o.left+=e.x),t.right&&(o.right+=e.x),t.top&&(o.top+=e.y),t.bottom&&(o.bottom+=e.y),o.width=o.right-o.left,o.height=o.bottom-o.top}export{addEdges,getStringOptionResult,rectToXY,resolveRectLike,tlbrToXywh,toFullRect,xywhToTlbr};
 | 
						|
//# sourceMappingURL=rect.prod.js.map
 |