Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Rectangle functions. #2377

Merged
merged 2 commits into from
Jan 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
==========

### 1.6 - 2015-02-02

* Breaking changes
* `Rectangle.intersectWith` was deprecated in Cesium 1.5. Use `Rectangle.intersection`, which is the same but returns `undefined` when two rectangles do not intersect.
* `Rectangle.isEmpty` was deprecated in Cesium 1.5.

### 1.5 - 2015-01-05

* Breaking changes
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/GeometryPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ define([
'./ComponentDatatype',
'./defaultValue',
'./defined',
'./deprecationWarning',
'./DeveloperError',
'./EncodedCartesian3',
'./GeographicProjection',
Expand Down Expand Up @@ -38,7 +37,6 @@ define([
ComponentDatatype,
defaultValue,
defined,
deprecationWarning,
DeveloperError,
EncodedCartesian3,
GeographicProjection,
Expand Down
59 changes: 0 additions & 59 deletions Source/Core/Rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ define([
'./defaultValue',
'./defined',
'./defineProperties',
'./deprecationWarning',
'./DeveloperError',
'./Ellipsoid',
'./freezeObject',
Expand All @@ -14,7 +13,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Ellipsoid,
freezeObject,
Expand Down Expand Up @@ -577,63 +575,6 @@ define([
return result;
};

/**
* Computes the intersection of two rectangles
*
* @deprecated
*
* @param {Rectangle} rectangle On rectangle to find an intersection
* @param {Rectangle} otherRectangle Another rectangle to find an intersection
* @param {Rectangle} [result] The object onto which to store the result.
* @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
*/
Rectangle.intersectWith = function(rectangle, otherRectangle, result) {
deprecationWarning('Rectangle.intersectWith', 'Rectangle.intersectWith was deprecated in Cesium 1.5. It will be removed in Cesium 1.6. Use Rectangle.intersection.');

//>>includeStart('debug', pragmas.debug);
if (!defined(rectangle)) {
throw new DeveloperError('rectangle is required');
}
if (!defined(otherRectangle)) {
throw new DeveloperError('otherRectangle is required.');
}
//>>includeEnd('debug');

var west = Math.max(rectangle.west, otherRectangle.west);
var south = Math.max(rectangle.south, otherRectangle.south);
var east = Math.min(rectangle.east, otherRectangle.east);
var north = Math.min(rectangle.north, otherRectangle.north);
if (!defined(result)) {
return new Rectangle(west, south, east, north);
}
result.west = west;
result.south = south;
result.east = east;
result.north = north;
return result;
};

/**
* Determines if the rectangle is empty, i.e., if <code>west >= east</code>
* or <code>south >= north</code>.
*
* @deprecated
*
* @param {Rectangle} rectangle The rectangle
* @returns {Boolean} True if the rectangle is empty; otherwise, false.
*/
Rectangle.isEmpty = function(rectangle) {
deprecationWarning('Rectangle.isEmpty', 'Rectangle.isEmpty was deprecated in Cesium 1.5. It will be removed in Cesium 1.6.');

//>>includeStart('debug', pragmas.debug);
if (!defined(rectangle)) {
throw new DeveloperError('rectangle is required');
}
//>>includeEnd('debug');

return rectangle.west >= rectangle.east || rectangle.south >= rectangle.north;
};

/**
* Returns true if the cartographic is on or inside the rectangle, false otherwise.
*
Expand Down