mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 22:56:11 +03:00
1540 Use OSD defined isArray
This commit is contained in:
parent
d8651bd268
commit
3ec9b66bc9
@ -689,9 +689,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
var isXYObject = function(obj) {
|
var isXYObject = function(obj) {
|
||||||
return obj instanceof $.Point || (typeof obj.x === 'number' && typeof obj.y === 'number');
|
return obj instanceof $.Point || (typeof obj.x === 'number' && typeof obj.y === 'number');
|
||||||
};
|
};
|
||||||
var isArray = function(obj) {
|
|
||||||
return Object.prototype.toString.call(obj) === '[object Array]';
|
|
||||||
};
|
|
||||||
var objectToSimpleXYObject = function(objs) {
|
var objectToSimpleXYObject = function(objs) {
|
||||||
return objs.map(function(obj) {
|
return objs.map(function(obj) {
|
||||||
try {
|
try {
|
||||||
@ -707,7 +705,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!isArray(polygons)) {
|
if ($.isArray(polygons)) {
|
||||||
throw new Error('Provided cropping polygon is not an array');
|
throw new Error('Provided cropping polygon is not an array');
|
||||||
}
|
}
|
||||||
this._croppingPolygons = polygons.map(function(polygon){
|
this._croppingPolygons = polygons.map(function(polygon){
|
||||||
|
Loading…
Reference in New Issue
Block a user