fix for some pool nesting errors
This commit is contained in:
parent
e001ab4505
commit
6cbf5abba0
3 changed files with 13 additions and 14 deletions
|
|
@ -87,12 +87,13 @@
|
|||
* @param {Bounds} parent
|
||||
* @returns {boolean} true if fully inside parent bounds
|
||||
*/
|
||||
PRO.isNested = function(parent) {
|
||||
PRO.isNested = function(parent, tolerance) {
|
||||
let grace = tolerance || CONF.precision_bounds;
|
||||
return (
|
||||
this.minx >= parent.minx - CONF.precision_bounds && // min-x
|
||||
this.maxx <= parent.maxx + CONF.precision_bounds && // max-x
|
||||
this.miny >= parent.miny - CONF.precision_bounds && // min-y
|
||||
this.maxy <= parent.maxy + CONF.precision_bounds // max-y
|
||||
this.minx >= parent.minx - grace && // min-x
|
||||
this.maxx <= parent.maxx + grace && // max-x
|
||||
this.miny >= parent.miny - grace && // min-y
|
||||
this.maxy <= parent.maxy + grace // max-y
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue