Skip to content

Instantly share code, notes, and snippets.

@Johnqing
Created August 14, 2014 07:56
Show Gist options
  • Save Johnqing/982071f5fcf31cdc06eb to your computer and use it in GitHub Desktop.
Save Johnqing/982071f5fcf31cdc06eb to your computer and use it in GitHub Desktop.
var isCoincide = function (a, b) {
var _XDif = Math.abs(a.x() - b.x());
var _YDif = Math.abs(a.y() - b.y());
return (_XDif <= a.width() && _YDif <= a.height()) || (_XDif <= b.width() && _YDif <= b.height());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment