parsegraph-rect
Advanced tools
Comparing version 1.5.2-dev to 1.5.2
@@ -1,216 +0,2 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else if(typeof exports === 'object') | ||
exports["parsegraph_rect"] = factory(); | ||
else | ||
root["parsegraph_rect"] = factory(); | ||
})(this, function() { | ||
return /******/ (() => { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ // The require scope | ||
/******/ var __webpack_require__ = {}; | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/define property getters */ | ||
/******/ (() => { | ||
/******/ // define getter functions for harmony exports | ||
/******/ __webpack_require__.d = (exports, definition) => { | ||
/******/ for(var key in definition) { | ||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
/******/ (() => { | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = (exports) => { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/************************************************************************/ | ||
var __webpack_exports__ = {}; | ||
/*!**********************!*\ | ||
!*** ./src/index.ts ***! | ||
\**********************/ | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) | ||
/* harmony export */ }); | ||
/* eslint-disable require-jsdoc */ | ||
var Rect = | ||
/** @class */ | ||
function () { | ||
function Rect(x, y, width, height) { | ||
this._x = x; | ||
this._y = y; | ||
this._width = width; | ||
this._height = height; | ||
} | ||
Rect.prototype.isNaN = function () { | ||
return isNaN(this._x) || isNaN(this._y) || isNaN(this._width) || isNaN(this._height); | ||
}; | ||
Rect.prototype.toNaN = function () { | ||
this._x = NaN; | ||
this._y = NaN; | ||
this._width = NaN; | ||
this._height = NaN; | ||
}; | ||
Rect.prototype.clear = function () { | ||
this.toNaN(); | ||
}; | ||
Rect.prototype.reset = function () { | ||
this.toNaN(); | ||
}; | ||
Rect.prototype.x = function () { | ||
return this._x; | ||
}; | ||
Rect.prototype.setX = function (x) { | ||
this._x = x; | ||
}; | ||
Rect.prototype.y = function () { | ||
return this._y; | ||
}; | ||
Rect.prototype.setY = function (y) { | ||
this._y = y; | ||
}; | ||
Rect.prototype.clone = function (target) { | ||
if (target) { | ||
this.copy(target); | ||
return target; | ||
} | ||
return new Rect(this.x(), this.y(), this.width(), this.height()); | ||
}; | ||
Rect.prototype.copy = function (dest) { | ||
if (!dest) { | ||
return this.clone(); | ||
} | ||
dest.setX(this.x()); | ||
dest.setY(this.y()); | ||
dest.setWidth(this.width()); | ||
dest.setHeight(this.height()); | ||
return dest; | ||
}; | ||
Rect.prototype.translate = function (x, y) { | ||
this.setX(this.x() + x); | ||
this.setY(this.y() + y); | ||
}; | ||
Rect.prototype.scale = function (sx, sy) { | ||
if (arguments.length < 2) { | ||
sy = sx; | ||
} | ||
this.setX(this.x() * sx); | ||
this.setY(this.y() * sy); | ||
this.setWidth(this.width() * sx); | ||
this.setHeight(this.height() * sy); | ||
}; | ||
Rect.prototype.height = function () { | ||
return this._height; | ||
}; | ||
Rect.prototype.setHeight = function (height) { | ||
this._height = height; | ||
}; | ||
Rect.prototype.width = function () { | ||
return this._width; | ||
}; | ||
Rect.prototype.w = function () { | ||
return this.width(); | ||
}; | ||
Rect.prototype.h = function () { | ||
return this.height(); | ||
}; | ||
Rect.prototype.setWidth = function (width) { | ||
this._width = width; | ||
}; | ||
Rect.prototype.toString = function () { | ||
return "[Rect x=" + this.x() + ", y=" + this.y() + ", w=" + this.width() + ", h=" + this.height() + "]"; | ||
}; | ||
Rect.prototype.vMin = function () { | ||
return this.y() - this.height() / 2; | ||
}; | ||
Rect.prototype.vMax = function () { | ||
return this.y() + this.height() / 2; | ||
}; | ||
Rect.prototype.hMin = function () { | ||
return this.x() - this.width() / 2; | ||
}; | ||
Rect.prototype.hMax = function () { | ||
return this.x() + this.width() / 2; | ||
}; | ||
Rect.prototype.include = function (bx, by, bwidth, bheight) { | ||
if (this.isNaN()) { | ||
this._x = bx; | ||
this._y = by; | ||
this._width = bwidth; | ||
this._height = bheight; | ||
return; | ||
} | ||
var ax = this._x; | ||
var ay = this._y; | ||
var awidth = this._width; | ||
var aheight = this._height; | ||
var leftEdge = Math.min(ax - awidth / 2, bx - bwidth / 2); | ||
var rightEdge = Math.max(ax + awidth / 2, bx + bwidth / 2); | ||
var topEdge = Math.min(ay - aheight / 2, by - bheight / 2); | ||
var bottomEdge = Math.max(ay + aheight / 2, by + bheight / 2); | ||
var w = rightEdge - leftEdge; | ||
var h = bottomEdge - topEdge; | ||
var x = leftEdge + w / 2; | ||
var y = topEdge + h / 2; | ||
this._x = x; | ||
this._y = y; | ||
this._width = w; | ||
this._height = h; | ||
}; | ||
return Rect; | ||
}(); | ||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rect); | ||
/******/ return __webpack_exports__; | ||
/******/ })() | ||
; | ||
}); | ||
!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.parsegraph_rect=i():t.parsegraph_rect=i()}(this,(function(){return(()=>{"use strict";var t={d:(i,e)=>{for(var h in e)t.o(e,h)&&!t.o(i,h)&&Object.defineProperty(i,h,{enumerable:!0,get:e[h]})},o:(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};t.r(i),t.d(i,{default:()=>h});var e=function(){function t(t,i,e,h){this._x=t,this._y=i,this._width=e,this._height=h}return t.prototype.isNaN=function(){return isNaN(this._x)||isNaN(this._y)||isNaN(this._width)||isNaN(this._height)},t.prototype.toNaN=function(){this._x=NaN,this._y=NaN,this._width=NaN,this._height=NaN},t.prototype.clear=function(){this.toNaN()},t.prototype.reset=function(){this.toNaN()},t.prototype.x=function(){return this._x},t.prototype.setX=function(t){this._x=t},t.prototype.y=function(){return this._y},t.prototype.setY=function(t){this._y=t},t.prototype.clone=function(i){return i?(this.copy(i),i):new t(this.x(),this.y(),this.width(),this.height())},t.prototype.copy=function(t){return t?(t.setX(this.x()),t.setY(this.y()),t.setWidth(this.width()),t.setHeight(this.height()),t):this.clone()},t.prototype.translate=function(t,i){this.setX(this.x()+t),this.setY(this.y()+i)},t.prototype.scale=function(t,i){arguments.length<2&&(i=t),this.setX(this.x()*t),this.setY(this.y()*i),this.setWidth(this.width()*t),this.setHeight(this.height()*i)},t.prototype.height=function(){return this._height},t.prototype.setHeight=function(t){this._height=t},t.prototype.width=function(){return this._width},t.prototype.w=function(){return this.width()},t.prototype.h=function(){return this.height()},t.prototype.setWidth=function(t){this._width=t},t.prototype.toString=function(){return"[Rect x="+this.x()+", y="+this.y()+", w="+this.width()+", h="+this.height()+"]"},t.prototype.vMin=function(){return this.y()-this.height()/2},t.prototype.vMax=function(){return this.y()+this.height()/2},t.prototype.hMin=function(){return this.x()-this.width()/2},t.prototype.hMax=function(){return this.x()+this.width()/2},t.prototype.include=function(t,i,e,h){if(this.isNaN())return this._x=t,this._y=i,this._width=e,void(this._height=h);var o=this._x,s=this._y,n=this._width,r=this._height,p=Math.min(o-n/2,t-e/2),u=Math.max(o+n/2,t+e/2),y=Math.min(s-r/2,i-h/2),c=u-p,f=Math.max(s+r/2,i+h/2)-y,a=p+c/2,d=y+f/2;this._x=a,this._y=d,this._width=c,this._height=f},t}();const h=e;return i})()})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "parsegraph-rect", | ||
"version": "1.5.2-dev", | ||
"version": "1.5.2", | ||
"description": "rectangle class", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
15797
7
42