* @function Bounds.prototype.containsBounds * @description 判断目标边界是否被当前边界包含在内。 * @example * var bounds = new Bounds(-180,-90,100,80); * var isContains = bounds.containsBounds( * new Bounds(-170,-90,100,80),true,true * ); * @param {Bounds} bounds - 目标边界。 *
(bounds, partial, inclusive)
| 541 | * @returns {boolean} 传入的边界是否被当前边界包含。 |
| 542 | */ |
| 543 | containsBounds(bounds, partial, inclusive) { |
| 544 | if (partial == null) { |
| 545 | partial = false; |
| 546 | } |
| 547 | if (inclusive == null) { |
| 548 | inclusive = true; |
| 549 | } |
| 550 | var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive); |
| 551 | var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive); |
| 552 | var topLeft = this.contains(bounds.left, bounds.top, inclusive); |
| 553 | var topRight = this.contains(bounds.right, bounds.top, inclusive); |
| 554 | |
| 555 | return (partial) ? (bottomLeft || bottomRight || topLeft || topRight) |
| 556 | : (bottomLeft && bottomRight && topLeft && topRight); |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * @function Bounds.prototype.determineQuadrant |
no test coverage detected